vivier / qemu-m68k Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Hi,
I used your virt machine with 68000 selected to revive the linux 68000 support.
I have a port of u-boot that runs on the 68000 too and creates a device tree from the bootinfo.
The sticking point I have right now is to make my 68000 enabled kernel boot on any 68k I need to patch some interrupt handling stuff to handle the vector/frame type field missing.
If the virt machine could report the select cpu via the bootinfo (it's always 68040 right now) I could flip which cpu is used and test my code works. But it seems like bootinfo doesn't actually have flags for 68000 or 68010 so I'm not sure what we would do there.
Thanks!
This crash occurs in m68k-dev
, but not 680x0-master-dev
:
Merged Build-Depends: dose-distcheck
Filtered Build-Depends: dose-distcheck
dpkg-deb: building package 'sbuild-build-depends-dose3-dummy' in '/<<BUILDDIR>>/resolver-q0pK4D/apt_archive/sbuild-build-depends-dose3-dummy.deb'.
dpkg-scanpackages: warning: Packages in archive but missing from override file:
dpkg-scanpackages: warning: sbuild-build-depends-core-dummy sbuild-build-depends-dose3-dummy
dpkg-scanpackages: info: Wrote 2 entries to output Packages file.
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
E: cannot create dummy archiveFailed to run apt-ftparchive.
E: Setting up apt archive failedE: Failed to explain bd-uninstallable
It should be possible to reproduce when following the sbuild setup guide and building any package: https://wiki.debian.org/M68k/sbuildQEMU
Most Quadras support an alternative interrupt mapping that is used by A/UX and Linux. It moves the SONIC ethernet IRQ from level 2 (VIA2) to level 3. If you patch Linux to disable this mapping (see patch inhibit-via_alt_mapping.txt), Linux crashes with "unexpected interrupt from 108". This error refers to the level 3 interrupt, since (108 >> 2) - 24 = 3. QEMU raises the level 3 interrupt regardless of via2[vBufB]. In this case, QEMU should raise the NuBus slot 9 interrupt (IRQ 56) instead. I've confirmed this on a Centris 610 (but not a Quadra 800). This bug is no problem for mainline Linux but could be a problem for some other operating systems.
Following the instructions here https://wiki.qemu.org/Documentation/Platforms/m68k I was able to successfully install debian. However, running apt-get update
stalls after the first 1-2MB.
root@debian:~# apt-get update
Get:1 http://ftp.ports.debian.org/debian-ports sid InRelease [55.3 kB]
Ign:1 http://ftp.ports.debian.org/debian-ports sid InRelease
Get:2 http://ftp.ports.debian.org/debian-ports sid/main all Packages [8,735 kB]
18% [2 Packages 2,155 kB/8,735 kB 25%]
I'm launching qemu with:
qemu-system-m68k -boot c \
-M q800 -serial none -serial mon:stdio -m 1000M \
-net nic,model=dp83932 -net user \
-append "root=/dev/sda2 rw console=ttyS0 console=tty" \
-kernel vmlinux-4.16.0-1-m68k \
-initrd initrd.img-4.16.0-1-m68k \
-drive file=m68k-deb10.qcow2,format=qcow2 \
-nographic
I see the same thing with qemu v6.0.0-rc5
and q800-dev
Following the how-to at https://wiki.debian.org/M68k/sbuildQEMU I was not able to buildqemu-68k, it misses functions from librdmacm
and libibverbs.a
. The libraries were installed but not the headers? Missing in build-dep? apt-rdepends --build-depends qemu | grep rdmacm
says it is in build-dep.
But the problem persisted even after installing librdmacm-dev, a make distclean
and a ./configure --target-list=m68k-linux-user --static --disable-glusterfs
.
A quick solution for me was to add /PATH/TO/librdmacm.a /PATH/TO/libibverbs.a
to the variable COMMON_LDADDS
in m68k-linux-user/Makefile
.
I'm currently writing a small guide on how to install and set up Debian/m68k on qemu-system-m68k from the q800-dev
branch but I'm having trouble to get a working serial console.
I have an older git snapshot installation where the serial console works fine but now the kernel messages stop once the kernel tries to initialize ttyS0.
Link to the the current guide I created on the Debian wiki: https://wiki.debian.org/M68k/QemuSystemM68k
One of the very few packages that still cause issues on qemu-m68k-user (qemu-m68k-system works fine) is the Firebird database.
It already fails when trying to install the package in a Debian unstable chroot:
(sid-m68k-sbuild)root@nofan:/# apt install firebird3.0-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
cpio dbus dmsetup groff-base libapparmor1 libargon2-1 libcap2 libcryptsetup12 libdbus-1-3 libdevmapper1.02.1 libexpat1 libidn11 libip4tc0 libjson-c3 libkmod2
libpam-systemd libpipeline1 man-db sensible-utils systemd systemd-sysv
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
firebird3.0-common firebird3.0-common-doc firebird3.0-server-core firebird3.0-utils libedit2 libfbclient2 libfreetype6 libglib2.0-0 libglib2.0-data libgraphite2-3
libharfbuzz0b libib-util libicu-le-hb0 libicu60 libpng16-16 libtommath1 libxml2 shared-mime-info xdg-user-dirs
Suggested packages:
firebird3.0-doc
The following NEW packages will be installed:
(...)
Setting up firebird3.0-server-core:m68k (3.0.3.32900.ds4-4) ...
Setting up shared-mime-info (1.9-2) ...
Setting up firebird3.0-server (3.0.3.32900.ds4-4) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Password for firebird 3.0
-------------------------
Firebird has a special user named SYSDBA, which is the user that has access to all databases. SYSDBA can also create new databases and users. Because of this, it is
necessary to secure SYSDBA with a password.
The password is stored in /etc/firebird/3.0/SYSDBA.password (readable only by root). You may modify it there (don't forget to update the security database too, using the
gsec utility), or you may use dpkg-reconfigure to update both.
If you don't enter a password, a random one will be used (and stored in SYSDBA.password).
Password for SYSDBA:
adduser: Warning: The home directory `/var/lib/firebird' does not belong to the user you are currently creating.
ConfigStorage: mutex pthread_mutex_init error, status = 95
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
dpkg: error processing package firebird3.0-server (--configure):
installed firebird3.0-server package post-installation script subprocess returned error exit status 134
Processing triggers for libc-bin (2.27-5) ...
Processing triggers for systemd (239-7) ...
Errors were encountered while processing:
firebird3.0-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
(sid-m68k-sbuild)root@nofan:/#
After the package has been (half-)installed, the crash can be reproduced with the following command:
(sid-m68k-sbuild)root@nofan:/# SEC_SQL=/usr/share/firebird/3.0/security.sql T=/tmp/tmp.2kBDCgAevm T_SEC=/tmp/tmp.2kBDCgAevm/security.fdb isql-fb -q
SQL> create database '/tmp/tmp.2kBDCgAevm/security.fdb';
ConfigStorage: mutex pthread_mutex_init error, status = 95
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
(sid-m68k-sbuild)root@nofan:/#
This might be related to issue #18 which I haven't tested for a while.
On qemu-user, gedit
crashes with an error message which indicates a problem with multi-threading:
(sid-m68k-sbuild)root@epyc:~# gedit
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x60040339
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x601bff46
(sid-m68k-sbuild)root@epyc:~#
On qemu-system, the crash doesn't show and gedit
just complains about a missing display:
root@pacman:~# gedit
[ 46.040000] random: crng init done
[ 46.040000] random: 7 urandom warning(s) missed due to ratelimiting
Unable to init server: Could not connect: Connection refused
(gedit:611): Gtk-WARNING **: 14:19:02.914: cannot open display:
root@pacman:~#
To reproduce, just install the gedit
package and try to run gedit
.
FWIW, the problem exists on qemu-sh4 as well. Didn't test with other architectures yet.
The following script is part of the Firefox build system:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# This script returns the number of items for the DW_AT_ranges corresponding
# to a given compilation unit. This is used as a helper to find a bug in some
# versions of GNU ld.
from __future__ import absolute_import
import subprocess
import sys
import re
def get_range_for(compilation_unit, debug_info):
'''Returns the range offset for a given compilation unit
in a given debug_info.'''
name = ranges = ''
search_cu = False
for nfo in debug_info.splitlines():
if 'DW_TAG_compile_unit' in nfo:
search_cu = True
elif 'DW_TAG_' in nfo or not nfo.strip():
if name == compilation_unit and ranges != '':
return int(ranges, 16)
name = ranges = ''
search_cu = False
if search_cu:
if 'DW_AT_name' in nfo:
name = nfo.rsplit(None, 1)[1]
elif 'DW_AT_ranges' in nfo:
ranges = nfo.rsplit(None, 1)[1]
return None
def get_range_length(range, debug_ranges):
'''Returns the number of items in the range starting at the
given offset.'''
length = 0
for line in debug_ranges.splitlines():
m = re.match('\s*([0-9a-fA-F]+)\s+([0-9a-fA-F]+)\s+([0-9a-fA-F]+)', line)
if m and int(m.group(1), 16) == range:
length += 1
return length
def main(bin, compilation_unit):
p = subprocess.Popen(['objdump', '-W', bin], stdout = subprocess.PIPE, stderr = subprocess.PIPE)
(out, err) = p.communicate()
sections = re.split('\n(Contents of the|The section) ', out)
debug_info = [s for s in sections if s.startswith('.debug_info')]
debug_ranges = [s for s in sections if s.startswith('.debug_ranges')]
if not debug_ranges or not debug_info:
return 0
range = get_range_for(compilation_unit, debug_info[0])
if range is not None:
return get_range_length(range, debug_ranges[0])
return -1
if __name__ == '__main__':
print main(*sys.argv[1:])
During the configure stage of Firefox, it is invoked as follows:
On x86_64:
glaubitz@ikarus:~$ echo 'int foo() {return 42;}' 'int bar() {return 1;}' 'int main() {return foo();}' > conftest.c
glaubitz@ikarus:~$ /usr/bin/gcc -std=gnu99 -o conftest.o -specs=/usr/share/dpkg/pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -fno-schedule-insns2 -fno-delete-null-pointer-checks -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -g -c conftest.c
glaubitz@ikarus:~$ /usr/bin/gcc -std=gnu99 -o conftest -Wl,--as-needed -Wl,--reduce-memory-overheads -Wl,--no-keep-memory -Wl,--stats -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id -g -Wl,--gc-sections conftest.o
/usr/bin/ld: total time in link: 0.012000
/usr/bin/ld: data size 3788800
glaubitz@ikarus:~$ python check_debug_ranges.py conftest conftest.c
3
glaubitz@ikarus:~$ python check_debug_ranges.py conftest.o conftest.c
3
glaubitz@ikarus:~$
Now, on Aranym:
root@mama:~# echo 'int foo() {return 42;}' 'int bar() {return 1;}' 'int main() {return foo();}' > conftest.c
root@mama:~# /usr/bin/gcc -std=gnu99 -o conftest.o -specs=/usr/share/dpkg/pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -fno-schedule-insns2 -fno-delete-null-pointer-checks -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -g -c conftest.c
root@mama:~# /usr/bin/gcc -std=gnu99 -o conftest -Wl,--as-needed -Wl,--reduce-memory-overheads -Wl,--no-keep-memory -Wl,--stats -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id -g -Wl,--gc-sections conftest.o
/usr/bin/ld: total time in link: 1.110000
/usr/bin/ld: data size 1409024
root@mama:~# python check_debug_ranges.py conftest conftest.c
3
root@mama:~# python check_debug_ranges.py conftest.o conftest.c
3
root@mama:~#
And, finally, qemu-m68k:
(sid-m68k-sbuild)root@ikarus:/# echo 'int foo() {return 42;}' 'int bar() {return 1;}' 'int main() {return foo();}' > conftest.c
(sid-m68k-sbuild)root@ikarus:/# /usr/bin/gcc -std=gnu99 -o conftest.o -specs=/usr/share/dpkg/pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -fno-schedule-insns2 -fno-delete-null-pointer-checks -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -g -c conftest.c
(sid-m68k-sbuild)root@ikarus:/# /usr/bin/gcc -std=gnu99 -o conftest -Wl,--as-needed -Wl,--reduce-memory-overheads -Wl,--no-keep-memory -Wl,--stats -Wl,-z,noexecstack -Wl,-z,text -Wl,--build-id -g -Wl,--gc-sections conftest.o
/usr/bin/ld: total time in link: 0.132000
/usr/bin/ld: data size 1409024
(sid-m68k-sbuild)root@ikarus:/# python check_debug_ranges.py conftest conftest.c
Traceback (most recent call last):
File "check_debug_ranges.py", line 62, in <module>
print main(*sys.argv[1:])
File "check_debug_ranges.py", line 54, in main
range = get_range_for(compilation_unit, debug_info[0])
File "check_debug_ranges.py", line 30, in get_range_for
name = nfo.rsplit(None, 1)[1]
IndexError: list index out of range
(sid-m68k-sbuild)root@ikarus:/# python check_debug_ranges.py conftest.o conftest.c
Traceback (most recent call last):
File "check_debug_ranges.py", line 62, in <module>
print main(*sys.argv[1:])
File "check_debug_ranges.py", line 54, in main
range = get_range_for(compilation_unit, debug_info[0])
File "check_debug_ranges.py", line 30, in get_range_for
name = nfo.rsplit(None, 1)[1]
IndexError: list index out of range
(sid-m68k-sbuild)root@ikarus:/#
On linux-m68k, the kernel adds a pseudo file called hardware
to the /proc
filesystem in order to display some hardware information. Some packages like console-setup
use this information to detect the type of m68k hardware being used.
Since console-setup
is required for some packages to be built like xorg-server
, I have written a very small kernel module which adds the pseudo file containing Model: Atari Falcon (with Afterburner040)
which I just copied from the Aranym emulator.
The source code for the kernel module is:
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
static int hello_proc_show(struct seq_file *m, void *v) {
seq_printf(m, "Model: Atari Falcon (with Afterburner040)\n");
return 0;
}
static int hello_proc_open(struct inode *inode, struct file *file) {
return single_open(file, hello_proc_show, NULL);
}
static const struct file_operations hello_proc_fops = {
.owner = THIS_MODULE,
.open = hello_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static int __init hello_proc_init(void) {
proc_create("hardware", 0, NULL, &hello_proc_fops);
return 0;
}
static void __exit hello_proc_exit(void) {
remove_proc_entry("hardware", NULL);
}
MODULE_LICENSE("GPL");
module_init(hello_proc_init);
module_exit(hello_proc_exit);
Now, in order to improve compatibility, I was wondering whether it would make sense to add support for the /proc/hardware
pseudo file to qemu-user as well? Of course, this would apply to qemu-user on Linux only.
Commit 8952fce8 "linux-user: add option to intercept execve() syscalls" adds the ability to specify that only this copy of the QEMU executable will be used for execve.
It has some issues:
I'm using this patch to work around some of this buy simply putting the path to the exe in the variable, however, it's not complete as I have to turn it off for SUID executables.
There are several ways this could be worked (all the way up to fakeroot/fakechroot support) but as I have solved my immediate problem (Which was to prevent x86 static executables running) it seemed best to just report this.
diff --git a/linux-user/main.c b/linux-user/main.c
index 7c71b72..f7f6268 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -4081,6 +4081,16 @@ static void handle_arg_execve(const char *arg)
char *ret;
int len;
+ if (arg && *arg)
+ {
+ ret = realpath(arg, buf);
+
+ if (ret != NULL) {
+ qemu_execve_path = strdup(buf);
+ return;
+ }
+ }
+
/* try getauxval() */
execfn = (const char *) getauxval(AT_EXECFN);
When installing/updating a recent version of udev on Debian, qemu complains about an unsupported syscall, namely 352:
Setting up udev (228-4+b1) ...
qemu: Unsupported syscall: 352
addgroup: The group `input' already exists as a system group. Exiting.
Adrian
is it worth updating the meson submodule from 0.55.1 to 0.55.3 - there seem to be quite a few useful improvements
https://github.com/mesonbuild/meson/tree/0.55
With the latest revision of the m68k-dev branch, gcc-7 segfaults:
(sid-m68k-sbuild)root@nofan:/# gcc -o rrdtool-test rrdtool-test.c
rrdtool-test.c:1:0: internal compiler error: Segmentation fault
#include <stdio.h>
executable file is not ELF
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
(sid-m68k-sbuild)root@nofan:/#
This is clearly a regression since earlier revisions work fine.
Trying to build an R package on Debian when using qemu
from git upstream fails with:
mkdir -p /<<PKGBUILDDIR>>/debian/r-bioc-biocparallel/usr/lib/R/site-library
xvfb-run --auto-servernum --server-num=20 -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" R CMD INSTALL -l /<<PKGBUILDDIR>>/debian/r-bioc-biocparallel/usr/lib/R/site-library --clean . "--built-timestamp='Fri, 13 Jul 2018 11:16:16 +0200'"
* installing *source* package 'BiocParallel' ...
Error in if (nc[currentIndex] == 0L) upperBlockIndex <- c(upperBlockIndex, :
missing value where TRUE/FALSE needed
ERROR: installing package DESCRIPTION failed for package 'BiocParallel'
* removing '/<<PKGBUILDDIR>>/debian/r-bioc-biocparallel/usr/lib/R/site-library/BiocParallel'
Building the same package using qemu-m68k
works just fine. So I guess it's one of the FPU patches that's missing.
Can you suggest which?
https://gist.github.com/rdebath/67d37e192f88e27d4993e84ab0eb85b0
I'm running:
Branch: 680x0-v2.6.0
Commit: 82c8f6b
The above is a piece of C code using long-longs and compiled without optimisation.
I've compiled it on x86 for the control and two minor variations on m68k.
If I compile it WITH optimisation it runs successfully, if I add in the call to the empty 'f()' function it runs successfully.
If I leave the register shuffling in the unmodified the code it is unsuccessful.
As GCC generates the same code for the two m68k versions (except for the single jsr to the empty function) it would appear that this bug is in the emulator.
Placing the call to 'f()' between any two C statements in this section of the code seems to prevent the problem occurring.
.L21:
.loc 1 120 0
move.l %a2,-(%sp)
pea 120.w
jsr memdump
addq.l #8,%sp
.loc 1 121 0
lea (48,%a2),%a0
move.l 56(%a2),%d0
move.l 60(%a2),%d1
move.l %d0,(%a0)
move.l %d1,4(%a0)
+ .loc 1 123 0
+ jsr f
.loc 1 125 0
lea (56,%a2),%a0
clr.l (%a0)
clr.l 4(%a0)
.loc 1 126 0
lea (48,%a2),%a3
lea (48,%a2),%a0
move.l 4(%a0),%a1
move.l (%a0),%a0
lea (64,%a2),%a4
move.l (%a4),%d2
move.l 4(%a4),%d3
move.l %d2,%d0
move.l %d3,%d1
move.l %d0,%d2
move.l %d1,%d3
add.l %d3,%d3
addx.l %d2,%d2
move.l %d2,%d0
move.l %d3,%d1
move.l %d0,%d2
move.l %d1,%d3
add.l %d3,%d3
addx.l %d2,%d2
add.l %d3,%d3
addx.l %d2,%d2
add.l %d3,%d1
addx.l %d2,%d0
move.l %a0,%d3
add.l %a1,%d1
addx.l %d3,%d0
clr.l %d4
subq.l #1,%d1
subx.l %d4,%d0
move.l %d0,(%a3)
move.l %d1,4(%a3)
.loc 1 127 0
lea (64,%a2),%a0
clr.l (%a0)
clr.l 4(%a0)
.loc 1 128 0
lea (40,%a2),%a0
move.l (%a0),%d0
move.l 4(%a0),%d1
clr.l %d5
subq.l #1,%d1
subx.l %d5,%d0
move.l %d0,(%a0)
move.l %d1,4(%a0)
.L20:
.loc 1 113 0
lea (40,%a2),%a0
move.l (%a0),%d0
move.l 4(%a0),%d1
sub.l %d2,%d2
tst.l %d1
subx.l %d2,%d0
jne .L22
.loc 1 130 0
move.l %a2,-(%sp)
pea 130.w
jsr memdump
When trying to install inkscape, we're running into an issue which seems FPU-related:
(sid-m68k-sbuild)root@jessie64:/# apt install inkscape
Reading package lists... Done
Building dependency tree
Reading state information... Done
(...)
Setting up inkscape (0.91-12+b1) ...
Sorry: OverflowError: cannot convert float infinity to integer
dpkg: error processing package inkscape (--configure):
subprocess installed post-installation script returned error exit status 101
Setting up libgtk2.0-bin (2.24.31-1) ...
(...)
Errors were encountered while processing:
inkscape
W: No sandbox user '_apt' on the system, can not drop privileges
E: Sub-process /usr/bin/dpkg returned an error code (1)
(sid-m68k-sbuild)root@jessie64:/#
Looking at the inkscape postinst package, the only possible culprit can only be the pycompile
command:
(sid-m68k-sbuild)root@jessie64:/# cat /var/lib/dpkg/info/inkscape.postinst
#!/bin/sh
set -e
# Automatically added by dh_python2:
if which pycompile >/dev/null 2>&1; then
pycompile -p inkscape /usr/share/inkscape
fi
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/bash_completion.d/inkscape 0.91-6~ -- "$@"
# End automatically added section
(sid-m68k-sbuild)root@jessie64:/#
which is indeed correct:
(sid-m68k-sbuild)root@jessie64:/# pycompile -p inkscape /usr/share/inkscape
Sorry: OverflowError: cannot convert float infinity to integer
(sid-m68k-sbuild)root@jessie64:/#
When playing Prince of Persia in 256-color on qemu-m68k (-M q800) graphics only update when player character moves across screen. Clicking the mouse or moving the curser will also update regions of the screen. Note: This does not occur with b/w mode and I tried Increasing memory in 256-color but the issue did not improve.
[ blackarch@mobile_c git ]$ git clone https://github.com/vivier/qemu-m68k.git
Cloning into 'qemu-m68k'...
remote: Enumerating objects: 2640, done.
remote: Counting objects: 100% (2640/2640), done.
remote: Compressing objects: 100% (1191/1191), done.
remote: Total 412402 (delta 1650), reused 1966 (delta 1444), pack-reused 409762
Receiving objects: 100% (412402/412402), 151.20 MiB | 716.00 KiB/s, done.
Resolving deltas: 100% (337633/337633), done.
Checking out files: 100% (6484/6484), done.
[ blackarch@mobile_c git ]$ cd qemu-m68k/
[ blackarch@mobile_c qemu-m68k ]$ git checkout m68k-dev
Branch 'm68k-dev' set up to track remote branch 'm68k-dev' from 'origin'.
Switched to a new branch 'm68k-dev'
[ blackarch@mobile_c qemu-m68k ]$ ./configure --target-list=m68k-linux-user --static --disable-glusterfs
ERROR: sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T.
You probably need to set PKG_CONFIG_LIBDIR
to point to the right pkg-config files for your
build target
[ blackarch@mobile_c qemu-m68k ]$
So, this is a rather obfuscated and weird bug, but there is definitely something wrong in qemu-m68k.
The package firebird2.5 (after applying the platform support patch in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=828141#10) currently fails to build from source on qemu-m68k but not on Aranym due to btyacc - which is embedded in the firebird2.5 sources - generating incorrect output. However, this happens only when compiling btyacc with "-O2". Compiling it without optimization does not trigger this problem.
Furthermore, the separate btyacc package in Debian - which was compiled a long time ago with an older version of gcc - does not show that behavior on qemu-m68k. The problem is triggered only when compiling btyacc with gcc-4.9 or newer (although we didn't test 4.7 or 4.8, but the working binary was compiled with a rather old gcc version, around gcc-4 or so). It does not matter whether btyacc is compiled on Aranym or qemu-m68k, but only whether -O2 is used or not. The -O2-built binary will always work correctly on Aranym and always misbehave on qemu-m68k.
Here is a detailed demonstration of the issue:
On Aranym:
root@mama:~# cd /tmp
root@mama:/tmp# mkdir firebird2.5
root@mama:/tmp# cd firebird2.5/
root@mama:/tmp/firebird2.5# dget -u http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.dsc
dget: retrieving http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.dsc
--2016-07-05 18:11:31-- http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.dsc
Resolving http.debian.net (http.debian.net)... 128.31.0.66, 5.153.231.35, 2001:41c8:1000:21::21:35
Connecting to http.debian.net (http.debian.net)|128.31.0.66|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://ftp.fau.de/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.dsc [following]
--2016-07-05 18:11:31-- http://ftp.fau.de/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.dsc
Resolving ftp.fau.de (ftp.fau.de)... 131.188.12.211, 2001:638:a000:1021:21::1
Connecting to ftp.fau.de (ftp.fau.de)|131.188.12.211|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3058 (3.0K)
Saving to: ‘firebird2.5_2.5.5.26952.ds4-5.dsc’
firebird2.5_2.5.5.26952.ds4-5.dsc 100%[=========================================================================================================================================>] 2.99K --.-KB/s in 0s
2016-07-05 18:11:31 (17.9 MB/s) - ‘firebird2.5_2.5.5.26952.ds4-5.dsc’ saved [3058/3058]
dget: retrieving http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4.orig.tar.xz
--2016-07-05 18:11:33-- http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4.orig.tar.xz
Resolving http.debian.net (http.debian.net)... 128.31.0.66, 5.153.231.35, 2001:41c8:1000:21::21:35
Connecting to http.debian.net (http.debian.net)|128.31.0.66|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://ftp.fau.de/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4.orig.tar.xz [following]
--2016-07-05 18:11:33-- http://ftp.fau.de/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4.orig.tar.xz
Resolving ftp.fau.de (ftp.fau.de)... 131.188.12.211, 2001:638:a000:1021:21::1
Connecting to ftp.fau.de (ftp.fau.de)|131.188.12.211|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4008160 (3.8M) [application/x-tar]
Saving to: ‘firebird2.5_2.5.5.26952.ds4.orig.tar.xz’
firebird2.5_2.5.5.26952.ds4.orig.tar.xz 100%[=========================================================================================================================================>] 3.82M 976KB/s in 4.0s
2016-07-05 18:11:37 (988 KB/s) - ‘firebird2.5_2.5.5.26952.ds4.orig.tar.xz’ saved [4008160/4008160]
dget: retrieving http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz
--2016-07-05 18:11:39-- http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz
Resolving http.debian.net (http.debian.net)... 128.31.0.66, 5.153.231.35, 2001:41c8:1000:21::21:35
Connecting to http.debian.net (http.debian.net)|128.31.0.66|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://ftp.fau.de/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz [following]
--2016-07-05 18:11:39-- http://ftp.fau.de/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz
Resolving ftp.fau.de (ftp.fau.de)... 131.188.12.211, 2001:638:a000:1021:21::1
Connecting to ftp.fau.de (ftp.fau.de)|131.188.12.211|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 111316 (109K) [application/x-tar]
Saving to: ‘firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz’
firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz 100%[=========================================================================================================================================>] 108.71K --.-KB/s in 0.1s
2016-07-05 18:11:39 (1.07 MB/s) - ‘firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz’ saved [111316/111316]
dpkg-source: info: extracting firebird2.5 in firebird2.5-2.5.5.26952.ds4
dpkg-source: info: unpacking firebird2.5_2.5.5.26952.ds4.orig.tar.xz
dpkg-source: info: unpacking firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz
dpkg-source: info: applying upstream/core-5068.patch
dpkg-source: info: applying out/honour-buildflags.patch
dpkg-source: info: applying trim-cflags.patch
dpkg-source: info: applying no-rpath.patch
dpkg-source: info: applying march-i486.patch
dpkg-source: info: applying separate-file-and-sem-perms.patch
dpkg-source: info: applying no-spurious-linkage.patch
dpkg-source: info: applying parallel-build.patch
dpkg-source: info: applying versioned-log-filename.patch
dpkg-source: info: applying link_atomic_ops.patch
dpkg-source: info: applying out/spelling.patch
root@mama:/tmp/firebird2.5# cd firebird2.5-2.5.5.26952.ds4/extern/btyacc/
root@mama:/tmp/firebird2.5/firebird2.5-2.5.5.26952.ds4/extern/btyacc# make CFLAGS=-O2
cc -O2 -c -o closure.o closure.c
cc -O2 -c -o error.o error.c
cc -O2 -c -o lalr.o lalr.c
cc -O2 -c -o lr0.o lr0.c
cc -O2 -c -o main.o main.c
cc -O2 -c -o mkpar.o mkpar.c
cc -O2 -c -o output.o output.c
cc -O2 -c -o mstring.o mstring.c
cc -O2 -c -o reader.o reader.c
cc -O2 -c -o readskel.o readskel.c
cc -O2 -c -o skeleton.o skeleton.c
cc -O2 -c -o symtab.o symtab.c
cc -O2 -c -o verbose.o verbose.c
cc -O2 -c -o warshall.o warshall.c
cc -o btyacc closure.o error.o lalr.o lr0.o main.o mkpar.o output.o mstring.o reader.o readskel.o skeleton.o symtab.o verbose.o warshall.o
main.o: In function create_file_names': main.c:(.text+0x5b8): warning: the use of
mktemp' is dangerous, better use mkstemp' or
mkdtemp'
root@mama:/tmp/firebird2.5/firebird2.5-2.5.5.26952.ds4/extern/btyacc# ./btyacc ../../src/dsql/parse.y
./btyacc: 11 shift/reduce conflicts, 5 reduce/reduce conflicts.
YYTABLESIZE: 70861
root@mama:/tmp/firebird2.5/firebird2.5-2.5.5.26952.ds4/extern/btyacc#
On qemu-m68k:
(sid-m68k-sbuild)root@ikarus:~# cd /tmp
(sid-m68k-sbuild)root@ikarus:/tmp# mkdir firebird2.5
(sid-m68k-sbuild)root@ikarus:/tmp# cd firebird2.5/
(sid-m68k-sbuild)root@ikarus:/tmp/firebird2.5# dget -u http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.dsc
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
dget: retrieving http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.dsc
--2016-07-05 18:08:31-- http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.dsc
Resolving http.debian.net (http.debian.net)... 128.31.0.66, 5.153.231.35, 2001:41c8:1000:21::21:35
Connecting to http.debian.net (http.debian.net)|128.31.0.66|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://mirror.liquidtelecom.com/debian/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.dsc [following]
--2016-07-05 18:08:32-- http://mirror.liquidtelecom.com/debian/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.dsc
Resolving mirror.liquidtelecom.com (mirror.liquidtelecom.com)... 197.155.77.1, 2c0f:fe40:8001:10::1
Connecting to mirror.liquidtelecom.com (mirror.liquidtelecom.com)|197.155.77.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3058 (3.0K)
Saving to: 'firebird2.5_2.5.5.26952.ds4-5.dsc'
firebird2.5_2.5.5.26952.ds4-5.dsc 100%[=========================================================================================================================================>] 2.99K --.-KB/s in 0.03s
2016-07-05 18:08:35 (103 KB/s) - 'firebird2.5_2.5.5.26952.ds4-5.dsc' saved [3058/3058]
dget: retrieving http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4.orig.tar.xz
--2016-07-05 18:08:35-- http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4.orig.tar.xz
Resolving http.debian.net (http.debian.net)... 128.31.0.66, 5.153.231.35, 2001:41c8:1000:21::21:35
Connecting to http.debian.net (http.debian.net)|128.31.0.66|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://mirror.liquidtelecom.com/debian/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4.orig.tar.xz [following]
--2016-07-05 18:08:36-- http://mirror.liquidtelecom.com/debian/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4.orig.tar.xz
Resolving mirror.liquidtelecom.com (mirror.liquidtelecom.com)... 197.155.77.1, 2c0f:fe40:8001:10::1
Connecting to mirror.liquidtelecom.com (mirror.liquidtelecom.com)|197.155.77.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4008160 (3.8M) [application/x-tar]
Saving to: 'firebird2.5_2.5.5.26952.ds4.orig.tar.xz'
firebird2.5_2.5.5.26952.ds4.orig.tar.xz 100%[=========================================================================================================================================>] 3.82M 1.28MB/s in 3.0s
2016-07-05 18:08:48 (1.28 MB/s) - 'firebird2.5_2.5.5.26952.ds4.orig.tar.xz' saved [4008160/4008160]
dget: retrieving http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz
--2016-07-05 18:08:48-- http://http.debian.net/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz
Resolving http.debian.net (http.debian.net)... 128.31.0.66, 5.153.231.35, 2001:41c8:1000:21::21:35
Connecting to http.debian.net (http.debian.net)|128.31.0.66|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://mirror.liquidtelecom.com/debian/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz [following]
--2016-07-05 18:08:49-- http://mirror.liquidtelecom.com/debian/debian/pool/main/f/firebird2.5/firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz
Resolving mirror.liquidtelecom.com (mirror.liquidtelecom.com)... 197.155.77.1, 2c0f:fe40:8001:10::1
Connecting to mirror.liquidtelecom.com (mirror.liquidtelecom.com)|197.155.77.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 111316 (109K) [application/x-tar]
Saving to: 'firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz'
firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz 100%[=========================================================================================================================================>] 108.71K 435KB/s in 0.3s
2016-07-05 18:08:50 (435 KB/s) - 'firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz' saved [111316/111316]
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
dpkg-source: info: extracting firebird2.5 in firebird2.5-2.5.5.26952.ds4
dpkg-source: info: unpacking firebird2.5_2.5.5.26952.ds4.orig.tar.xz
dpkg-source: info: unpacking firebird2.5_2.5.5.26952.ds4-5.debian.tar.xz
dpkg-source: info: applying upstream/core-5068.patch
dpkg-source: info: applying out/honour-buildflags.patch
dpkg-source: info: applying trim-cflags.patch
dpkg-source: info: applying no-rpath.patch
dpkg-source: info: applying march-i486.patch
dpkg-source: info: applying separate-file-and-sem-perms.patch
dpkg-source: info: applying no-spurious-linkage.patch
dpkg-source: info: applying parallel-build.patch
dpkg-source: info: applying versioned-log-filename.patch
dpkg-source: info: applying link_atomic_ops.patch
dpkg-source: info: applying out/spelling.patch
(sid-m68k-sbuild)root@ikarus:/tmp/firebird2.5# cd firebird2.5-2.5.5.26952.ds4/extern/btyacc/
(sid-m68k-sbuild)root@ikarus:/tmp/firebird2.5/firebird2.5-2.5.5.26952.ds4/extern/btyacc# make CFLAGS=-O2
cc -O2 -c -o closure.o closure.c
cc -O2 -c -o error.o error.c
cc -O2 -c -o lalr.o lalr.c
cc -O2 -c -o lr0.o lr0.c
cc -O2 -c -o main.o main.c
cc -O2 -c -o mkpar.o mkpar.c
cc -O2 -c -o output.o output.c
cc -O2 -c -o mstring.o mstring.c
cc -O2 -c -o reader.o reader.c
cc -O2 -c -o readskel.o readskel.c
cc -O2 -c -o skeleton.o skeleton.c
cc -O2 -c -o symtab.o symtab.c
cc -O2 -c -o verbose.o verbose.c
cc -O2 -c -o warshall.o warshall.c
cc -o btyacc closure.o error.o lalr.o lr0.o main.o mkpar.o output.o mstring.o reader.o readskel.o skeleton.o symtab.o verbose.o warshall.o
main.o: In function create_file_names': main.c:(.text+0x5b8): warning: the use of
mktemp' is dangerous, better use mkstemp' or
mkdtemp'
(sid-m68k-sbuild)root@ikarus:/tmp/firebird2.5/firebird2.5-2.5.5.26952.ds4/extern/btyacc# ./btyacc ../../src/dsql/parse.y
./btyacc: 2 rules never reduced
./btyacc: 8 shift/reduce conflicts, 3 reduce/reduce conflicts.
YYTABLESIZE: 28188
(sid-m68k-sbuild)root@ikarus:/tmp/firebird2.5/firebird2.5-2.5.5.26952.ds4/extern/btyacc#
Hi!
I was recently testing qemu-m68k on a sparc64 machine in the hope to work-around the futex issues we have when running on little-endian hosts (because m68k is big-endian, the futex counter is not passed evaluated properly by the kernel), but to my surprise, qemu-m68k actually crashed:
root@deb4g:~/qemu-m68k# gdb ./m68k-linux-user/qemu-m68k
GNU gdb (Debian 7.11.1-2+b2) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "sparc64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./m68k-linux-user/qemu-m68k...done.
(gdb) run /srv/sid-m68k-sbuild/lib/ld.so.1
Starting program: /root/qemu-m68k/m68k-linux-user/qemu-m68k /srv/sid-m68k-sbuild/lib/ld.so.1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/sparc64-linux-gnu/libthread_db.so.1".
[New Thread 0xfff80001007ff910 (LWP 141817)]
Thread 1 "qemu-m68k" received signal SIGBUS, Bus error.
0x000000006041e738 in static_code_gen_buffer ()
(gdb) bt
#0 0x000000006041e738 in static_code_gen_buffer ()
#1 0x0000000060006038 in cpu_tb_exec (cpu=0x624b9550, itb=0xfff8000100883940) at /root/qemu-m68k/cpu-exec.c:160
#2 0x0000000060006d1c in cpu_loop_exec_tb (cpu=0x624b9550, tb=0xfff8000100883940, last_tb=0x7feffffea38, tb_exit=0x7feffffea
#3 0x0000000060006f78 in cpu_exec (cpu=0x624b9550) at /root/qemu-m68k/cpu-exec.c:619
#4 0x00000000600469b4 in cpu_loop (env=0x624c1990) at /root/qemu-m68k/linux-user/main.c:3272
#5 0x0000000060049044 in main (argc=2, argv=0x7fefffff5d8, envp=0x7fefffff5f0) at /root/qemu-m68k/linux-user/main.c:5000
(gdb)
This was tested with the 680x0-master-dev branch. Will also now try the m68k-dev branch, hadn't seen that one before.
Adrian
Several packages in Debian like imagemagick or gettext utilize OpenMP to parallize execution and improve performance.
While OpenMP generally works on qemu-m68k (tested with some examples from [1]), qemu-m68k can lock up in user mode when building imagemagick or gettext with the --enable-openmp configure parameter.
For example, the imagemagick build gets stuck when running convert
to create some PNG icons from the SVG icons in the source tree [2]:
Make icons for size 8x8... E: Caught signal ‘Terminated’: terminating immediately debian/rules:369: recipe for target 'override_dh_auto_install-arch_iconcache_quantum.q16' failed make[1]: *** [override_dh_auto_install-arch_iconcache_quantum.q16] Terminated debian/rules:189: recipe for target 'binary-arch' failed make: *** [binary-arch] Terminated E: Build killed with signal TERM after 60 minutes of inactivity
This issues goes away immediately when disabling OpenMP support per configure option.
With gettext, the problem occurs in msgmerge
which is part of gettext and used when building other packages like apt [3]:
Generating ../build/po/domains/apt/bg.po echo ../build/po/domains/apt/bg.po : bg.po ../build/po/apt.pot > ../build/po/apt_bg.po.d /usr/bin//msgmerge --add-location=file bg.po ../build/po/apt.pot -o ../build/po/domains/apt/bg.po .........make[2]: *** wait: No child processes. Stop. make[2]: *** Waiting for unfinished jobs.... make[2]: *** wait: No child processes. Stop. make[1]: *** wait: No child processes. Stop. make[1]: *** Waiting for unfinished jobs.... make[1]: *** wait: No child processes. Stop. make: *** wait: No child processes. Stop. make: *** Waiting for unfinished jobs.... make: *** wait: No child processes. Stop. Build killed with signal TERM after 30 minutes of inactivity
Again, the problem goes away the moment we build gettext without OpenMP support.
Unfortunately, I have not yet figured out exactly which OpenMP directive is causing the issues since the basic OpenMP examples from [1] don't cause any problems. But I presume it's an issue with when using atomic/critical sections in OpenMP.
[1] https://computing.llnl.gov/tutorials/openMP/exercise.html
[2] https://buildd.debian.org/status/fetch.php?pkg=imagemagick&arch=m68k&ver=8%3A6.9.6.2%2Bdfsg-2&stamp=1476373630
[3] https://buildd.debian.org/status/fetch.php?pkg=apt&arch=m68k&ver=1.2.11&stamp=1461880964
Hi!
Updating to the latest revision 03d386a resulted in 'apt-get update' segfaulting when using qemu-user mode:
(sid-m68k-sbuild)root@z6:/# apt-get update
Reading package lists... Done
E: Method http has died unexpectedly!
E: Sub-process http received a segmentation fault.
(sid-m68k-sbuild)root@z6:/#
Reverting to an older version helps. Haven't bisected the code yet, however.
Adrian
The following code produces incorrect code on qemu-m68k while working on real hardware:
#include <stdio.h>
#include <math.h>
int main(void){
double rrdnan,rrdinf,rrdc,rrdzero;
;
/* some math to see if we get a floating point exception */
rrdzero=sin(0.0); /* don't let the compiler optimize us away */
rrdnan=0.0/rrdzero; /* especially here */
rrdinf=1.0/rrdzero; /* and here. I want to know if it can do the magic */
/* at run time without sig fpe */
rrdc = rrdinf + rrdnan;
rrdc = rrdinf / rrdnan;
if (! isnan(rrdnan)) {printf ("not isnan(NaN) ... "); return 1;}
if (rrdnan == rrdnan) {printf ("nan == nan ... "); return 1;}
if (! isinf(rrdinf)) {printf ("not isinf(oo) ... "); return 1;}
if (! isinf(-rrdinf)) {printf ("not isinf(-oo) ... "); return 1;}
if (! rrdinf > 0) {printf ("not inf > 0 ... "); return 1;}
if (! -rrdinf < 0) {printf ("not -inf < 0 ... "); return 1;}
return 0;
}
On my Amiga 4000, I get:
root@elgar:~> gcc -o rrdtool-test rrdtool-test.c
root@elgar:~> ./rrdtool-test
root@elgar:~> echo $?
0
root@elgar:~>
On qemu-m68k, I get:
(sid-m68k-sbuild)root@nofan:/# gcc -o rrdtool-test rrdtool-test.c
(sid-m68k-sbuild)root@nofan:/# ./rrdtool-test
not isinf(oo) ... (sid-m68k-sbuild)root@nofan:/# echo $?
1
(sid-m68k-sbuild)root@nofan:/#
See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890466
Recent changes have introduced a regression when running aptitude
on qemu-m68k, crashing with:
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x6019a64f
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x601b393b
See https://buildd.debian.org/status/fetch.php?pkg=elinks&arch=m68k&ver=0.13%7E20190125-1&stamp=1549095796&raw=0 for a sample build log.
I initially thought this to be a regression in qemu because the problem just showed up recently but it also shows with older qemu versions which used to work fine in the past, so I assume something changed in aptitude
which is now causing the problem.
Reproducer is simple after installing aptitude
:
(sid-m68k-sbuild)root@nofan:/# aptitude -y --without-recommends -o Dpkg::Options::=--force-confold -o Aptitude::CmdLine::Ignore-Trust-Violations=false -o Aptitude::ProblemResolver::StepScore=100 -o Aptitude::ProblemResolver::SolutionCost="safety, priority, non-default-versions" -o Aptitude::ProblemResolver::Hints::KeepDummy="reject sbuild-build-depends-core-dummy :UNINST" -o Aptitude::ProblemResolver::Keep-All-Level=55000 -o Aptitude::ProblemResolver::Remove-Essential-Level=maximum install vim
Warning: Invalid locale (please review locale settings, this might lead to problems later):
locale::facet::_S_create_c_locale name not valid
The following NEW packages will be installed:
libgpm2{a} vim vim-common{a} vim-runtime{a} xxd{a}
0 packages upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 7192 kB/7226 kB of archives. After unpacking 33.4 MB will be used.
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x6010900d
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x601221c9
Segmentation fault
(sid-m68k-sbuild)root@nofan:/#
Hi Vivier,
first of all, many thanks for your excellent work in qemu-m68k. I hope that soon your work will become official in the qemu tree.
I'm writing a little "bios" for the m68k, and I was able to start the m68k quadra 800 emulator from
ROM, executing C code and send characters to the serial port. Executing this little fragment (in order to load the msp):
ori.w #MBIT,%sr // select Master SSP
lea.l msp_stack,%sp // load the stack
andi.w #~MBIT,%sr // select back the ISP
gives me this error:
tcg.c:1981: tcg_reg_alloc_op: Assertion `ts->val_type == 1' failed.
I've tried some changes, but no matter what instructions you put between the ori/andi, the result is the same. Unfortunately I am not confident with the innards of the qemu tcg, so I am kindly filing this issue.
Many thanks again and best regards.
G
[ blackarch@mobile_c git ]$ git clone https://github.com/vivier/qemu-m68k.git
Cloning into 'qemu-m68k'...
remote: Enumerating objects: 2640, done.
remote: Counting objects: 100% (2640/2640), done.
remote: Compressing objects: 100% (1191/1191), done.
remote: Total 412402 (delta 1650), reused 1966 (delta 1444), pack-reused 409762
Receiving objects: 100% (412402/412402), 151.20 MiB | 607.00 KiB/s, done.
Resolving deltas: 100% (337633/337633), done.
Checking out files: 100% (5662/5662), done.
[ blackarch@mobile_c git ]$ cd qemu-m68k/
[ blackarch@mobile_c qemu-m68k ]$ ./configure --target-list=m68k-softmmu --disable-glusterfs
ERROR: Cannot use 'python', Python 2.6 or later is required.
Note that Python 3 or later is not yet supported.
Use --python=/path/to/python to specify a supported Python.
[ blackarch@mobile_c qemu-m68k ]$ whereis python
python: /usr/bin/python /usr/bin/python3.7-config /usr/bin/python3.7 /usr/bin/python2.7-config /usr/bin/python2.7 /usr/bin/python3.7m /usr/bin/python3.7m-config /usr/lib/python3.7 /usr/lib/python2.7 /usr/lib/python3.5 /usr/local/lib/python3.7 /usr/include/python2.7 /usr/include/python3.7m /usr/share/man/man1/python.1.gz
[ blackarch@mobile_c qemu-m68k ]$ ./configure --target-list=m68k-softmmu --disable-glusterfs --python=/usr/bin/python2.7
Install prefix /usr/local
BIOS directory /usr/local/share/qemu
firmware path /usr/local/share/qemu-firmware
binary directory /usr/local/bin
library directory /usr/local/lib
module directory /usr/local/lib/qemu
libexec directory /usr/local/libexec
include directory /usr/local/include
config directory /usr/local/etc
local state directory /usr/local/var
Manual directory /usr/local/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path /home/mobile_c/git/qemu-m68k
GIT binary git
GIT submodules ui/keycodemapdb dtc
C compiler cc
Host C compiler cc
C++ compiler c++
Objective-C compiler clang
ARFLAGS rv
CFLAGS -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g
QEMU_CFLAGS -I/usr/include/pixman-1 -I$(SRC_PATH)/dtc/libfdt -Werror -DHAS_LIBSSH2_SFTP_FSYNC -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DNCURSES_WIDECHAR -D_GNU_SOURCE -D_DEFAULT_SOURCE -fPIE -DPIE -m64 -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1 -I/usr/include/libpng16 -I/usr/include/libdrm -I/usr/include/capstone
LDFLAGS -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64 -g
make make
install install
python /usr/bin/python2.7 -B
smbd /usr/sbin/smbd
module support no
host CPU x86_64
host big endian no
target list m68k-softmmu
gprof enabled no
sparse enabled no
strip binaries yes
profiler no
static build no
SDL support yes (2.0.9)
GTK support yes (3.24.4)
GTK GL support yes
VTE support yes (0.54.3)
TLS priority NORMAL
GNUTLS support yes
GNUTLS rnd yes
libgcrypt no
libgcrypt kdf no
nettle yes (3.4.1)
nettle kdf yes
libtasn1 yes
curses support yes
virgl support yes
curl support yes
mingw32 support no
Audio drivers oss
Block whitelist (rw)
Block whitelist (ro)
VirtFS support yes
Multipath support no
VNC support yes
VNC SASL support yes
VNC JPEG support yes
VNC PNG support yes
xen support no
brlapi support no
bluez support yes
Documentation yes
PIE yes
vde support yes
netmap support no
Linux AIO support yes
ATTR/XATTR support yes
Install blobs yes
KVM support yes
HAX support no
TCG support yes
TCG debug enabled no
TCG interpreter no
RDMA support no
fdt support yes
preadv support yes
fdatasync yes
madvise yes
posix_madvise yes
libcap-ng support yes
vhost-net support yes
vhost-scsi support yes
vhost-vsock support yes
vhost-user support yes
Trace backends log
spice support no
rbd support yes
xfsctl support yes
smartcard support yes
libusb yes
usb net redir yes
OpenGL support yes
OpenGL dmabufs yes
libiscsi support yes
libnfs support yes
build guest agent yes
QGA VSS support no
QGA w32 disk info no
QGA MSI support no
seccomp support yes
coroutine backend ucontext
coroutine pool yes
debug stack usage no
crypto afalg no
GlusterFS support no
gcov gcov
gcov enabled no
TPM support yes
libssh2 support yes
TPM passthrough yes
TPM emulator yes
QOM debugging yes
Live block migration yes
lzo support yes
snappy support yes
bzip2 support yes
NUMA host support yes
tcmalloc support no
jemalloc support no
avx2 optimization yes
replication support yes
VxHS block device no
capstone system
[ blackarch@mobile_c qemu-m68k ]$ make
GEN m68k-softmmu/config-devices.mak.tmp
GEN m68k-softmmu/config-devices.mak
GEN config-all-devices.mak
GEN config-host.h
GIT ui/keycodemapdb dtc
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Submodule 'ui/keycodemapdb' (git://git.qemu.org/keycodemapdb.git) registered for path 'ui/keycodemapdb'
Cloning into '/home/mobile_c/git/qemu-m68k/dtc'...
Cloning into '/home/mobile_c/git/qemu-m68k/ui/keycodemapdb'...
mkdir -p dtc/libfdt
mkdir -p dtc/tests
DEP tests/dumptrees.c
DEP tests/trees.S
DEP tests/testutils.c
DEP tests/value-labels.c
DEP tests/asm_tree_dump.c
DEP tests/truncated_property.c
DEP tests/check_path.c
DEP tests/overlay_bad_fixup.c
DEP tests/overlay.c
DEP tests/subnode_iterate.c
DEP tests/property_iterate.c
DEP tests/integer-expressions.c
DEP tests/utilfdt_test.c
DEP tests/path_offset_aliases.c
DEP tests/add_subnode_with_nops.c
DEP tests/dtbs_equal_unordered.c
DEP tests/dtb_reverse.c
DEP tests/dtbs_equal_ordered.c
DEP tests/extra-terminating-null.c
DEP tests/incbin.c
DEP tests/boot-cpuid.c
DEP tests/phandle_format.c
DEP tests/path-references.c
DEP tests/references.c
DEP tests/string_escapes.c
DEP tests/propname_escapes.c
DEP tests/appendprop2.c
DEP tests/appendprop1.c
DEP tests/del_node.c
DEP tests/del_property.c
DEP tests/setprop.c
DEP tests/set_name.c
DEP tests/rw_tree1.c
DEP tests/open_pack.c
DEP tests/nopulate.c
DEP tests/mangle-layout.c
DEP tests/move_and_save.c
DEP tests/sw_tree1.c
DEP tests/nop_node.c
DEP tests/nop_property.c
DEP tests/setprop_inplace.c
DEP tests/stringlist.c
DEP tests/addr_size_cells.c
DEP tests/notfound.c
DEP tests/sized_cells.c
DEP tests/char_literal.c
DEP tests/get_alias.c
DEP tests/node_offset_by_compatible.c
DEP tests/node_check_compatible.c
DEP tests/node_offset_by_phandle.c
DEP tests/node_offset_by_prop_value.c
DEP tests/parent_offset.c
DEP tests/supernode_atdepth_offset.c
DEP tests/get_path.c
DEP tests/get_phandle.c
DEP tests/getprop.c
DEP tests/get_name.c
DEP tests/path_offset.c
DEP tests/subnode_offset.c
DEP tests/find_property.c
DEP tests/root_node.c
DEP tests/get_mem_rsv.c
DEP libfdt/fdt_overlay.c
DEP libfdt/fdt_addresses.c
DEP libfdt/fdt_empty_tree.c
DEP libfdt/fdt_strerror.c
DEP libfdt/fdt_rw.c
DEP libfdt/fdt_sw.c
DEP libfdt/fdt_wip.c
DEP libfdt/fdt_ro.c
DEP libfdt/fdt.c
DEP util.c
DEP fdtput.c
DEP fdtget.c
DEP fdtdump.c
LEX convert-dtsv0-lexer.lex.c
DEP convert-dtsv0-lexer.lex.c
DEP srcpos.c
BISON dtc-parser.tab.c
DEP dtc-parser.tab.c
LEX dtc-lexer.lex.c
DEP dtc-lexer.lex.c
DEP treesource.c
DEP livetree.c
DEP fstree.c
DEP flattree.c
DEP dtc.c
DEP data.c
DEP checks.c
CHK version_gen.h
UPD version_gen.h
DEP util.c
CHK version_gen.h
CC libfdt/fdt.o
CC libfdt/fdt_ro.o
CC libfdt/fdt_wip.o
CC libfdt/fdt_sw.o
CC libfdt/fdt_rw.o
CC libfdt/fdt_strerror.o
CC libfdt/fdt_empty_tree.o
CC libfdt/fdt_addresses.o
CC libfdt/fdt_overlay.o
AR libfdt/libfdt.a
ar: creating libfdt/libfdt.a
a - libfdt/fdt.o
a - libfdt/fdt_ro.o
a - libfdt/fdt_wip.o
a - libfdt/fdt_sw.o
a - libfdt/fdt_rw.o
a - libfdt/fdt_strerror.o
a - libfdt/fdt_empty_tree.o
a - libfdt/fdt_addresses.o
a - libfdt/fdt_overlay.o
GEN qemu-options.def
GEN qmp-commands.h
GEN qapi-types.h
GEN qapi-visit.h
GEN qapi-event.h
GEN qmp-marshal.c
GEN qapi-types.c
GEN qapi-visit.c
GEN qapi-event.c
GEN qmp-introspect.h
GEN qmp-introspect.c
GEN trace/generated-tcg-tracers.h
GEN trace/generated-helpers-wrappers.h
GEN trace/generated-helpers.h
GEN trace/generated-helpers.c
GEN module_block.h
GEN ui/input-keymap-linux-to-qcode.c
GEN ui/input-keymap-qcode-to-qnum.c
GEN ui/input-keymap-qnum-to-qcode.c
GEN tests/test-qapi-types.h
GEN tests/test-qapi-visit.h
GEN tests/test-qmp-commands.h
GEN tests/test-qapi-event.h
GEN tests/test-qmp-introspect.h
GEN trace-root.h
GEN util/trace.h
GEN crypto/trace.h
GEN io/trace.h
GEN migration/trace.h
GEN block/trace.h
GEN chardev/trace.h
GEN hw/block/trace.h
GEN hw/block/dataplane/trace.h
GEN hw/char/trace.h
GEN hw/intc/trace.h
GEN hw/net/trace.h
GEN hw/virtio/trace.h
GEN hw/audio/trace.h
GEN hw/misc/trace.h
GEN hw/usb/trace.h
GEN hw/scsi/trace.h
GEN hw/nvram/trace.h
GEN hw/display/trace.h
GEN hw/input/trace.h
GEN hw/timer/trace.h
GEN hw/dma/trace.h
GEN hw/sparc/trace.h
GEN hw/sd/trace.h
GEN hw/isa/trace.h
GEN hw/mem/trace.h
GEN hw/i386/trace.h
GEN hw/i386/xen/trace.h
GEN hw/9pfs/trace.h
GEN hw/ppc/trace.h
GEN hw/pci/trace.h
GEN hw/s390x/trace.h
GEN hw/vfio/trace.h
GEN hw/acpi/trace.h
GEN hw/arm/trace.h
GEN hw/alpha/trace.h
GEN hw/xen/trace.h
GEN hw/ide/trace.h
GEN ui/trace.h
GEN audio/trace.h
GEN net/trace.h
GEN target/arm/trace.h
GEN target/i386/trace.h
GEN target/mips/trace.h
GEN target/sparc/trace.h
GEN target/s390x/trace.h
GEN target/ppc/trace.h
GEN qom/trace.h
GEN linux-user/trace.h
GEN qapi/trace.h
GEN accel/tcg/trace.h
GEN accel/kvm/trace.h
GEN nbd/trace.h
GEN scsi/trace.h
GEN trace-root.c
GEN util/trace.c
GEN crypto/trace.c
GEN io/trace.c
GEN migration/trace.c
GEN block/trace.c
GEN chardev/trace.c
GEN hw/block/trace.c
GEN hw/block/dataplane/trace.c
GEN hw/char/trace.c
GEN hw/intc/trace.c
GEN hw/net/trace.c
GEN hw/virtio/trace.c
GEN hw/audio/trace.c
GEN hw/misc/trace.c
GEN hw/usb/trace.c
GEN hw/scsi/trace.c
GEN hw/nvram/trace.c
GEN hw/display/trace.c
GEN hw/input/trace.c
GEN hw/timer/trace.c
GEN hw/dma/trace.c
GEN hw/sparc/trace.c
GEN hw/sd/trace.c
GEN hw/isa/trace.c
GEN hw/mem/trace.c
GEN hw/i386/trace.c
GEN hw/i386/xen/trace.c
GEN hw/9pfs/trace.c
GEN hw/ppc/trace.c
GEN hw/pci/trace.c
GEN hw/s390x/trace.c
GEN hw/vfio/trace.c
GEN hw/acpi/trace.c
GEN hw/arm/trace.c
GEN hw/alpha/trace.c
GEN hw/xen/trace.c
GEN hw/ide/trace.c
GEN ui/trace.c
GEN audio/trace.c
GEN net/trace.c
GEN target/arm/trace.c
GEN target/i386/trace.c
GEN target/mips/trace.c
GEN target/sparc/trace.c
GEN target/s390x/trace.c
GEN target/ppc/trace.c
GEN qom/trace.c
GEN linux-user/trace.c
GEN qapi/trace.c
GEN accel/tcg/trace.c
GEN accel/kvm/trace.c
GEN nbd/trace.c
GEN scsi/trace.c
CHK version_gen.h
CC tests/qemu-iotests/socket_scm_helper.o
LINK tests/qemu-iotests/socket_scm_helper
GEN docs/version.texi
GEN qemu-options.texi
GEN qemu-monitor.texi
GEN qemu-img-cmds.texi
GEN qemu-monitor-info.texi
GEN qemu-doc.html
GEN qemu-doc.txt
GEN qemu.1
GEN qemu-img.1
GEN qemu-nbd.8
GEN qemu-ga.8
GEN docs/interop/qemu-qmp-qapi.texi
GEN docs/interop/qemu-qmp-ref.html
GEN docs/interop/qemu-qmp-ref.txt
GEN docs/interop/qemu-qmp-ref.7
GEN docs/interop/qemu-ga-qapi.texi
GEN docs/interop/qemu-ga-ref.html
GEN docs/interop/qemu-ga-ref.txt
GEN docs/interop/qemu-ga-ref.7
GEN docs/qemu-block-drivers.7
GEN fsdev/virtfs-proxy-helper.1
GEN qga/qapi-generated/qga-qapi-types.h
GEN qga/qapi-generated/qga-qapi-visit.h
GEN qga/qapi-generated/qga-qmp-commands.h
CC qga/commands.o
CC qga/guest-agent-command-state.o
CC qga/main.o
CC qga/commands-posix.o
CC qga/channel-posix.o
GEN qga/qapi-generated/qga-qapi-types.c
CC qga/qapi-generated/qga-qapi-types.o
GEN qga/qapi-generated/qga-qapi-visit.c
CC qga/qapi-generated/qga-qapi-visit.o
GEN qga/qapi-generated/qga-qmp-marshal.c
CC qga/qapi-generated/qga-qmp-marshal.o
CC qmp-introspect.o
CC qapi-types.o
CC qapi-visit.o
CC qapi-event.o
CC qapi/qapi-visit-core.o
CC qapi/qapi-dealloc-visitor.o
CC qapi/qobject-input-visitor.o
CC qapi/qobject-output-visitor.o
CC qapi/qmp-registry.o
CC qapi/qmp-dispatch.o
CC qapi/string-input-visitor.o
CC qapi/string-output-visitor.o
CC qapi/opts-visitor.o
CC qapi/qapi-clone-visitor.o
CC qapi/qmp-event.o
CC qapi/qapi-util.o
CC qobject/qnull.o
CC qobject/qnum.o
CC qobject/qstring.o
CC qobject/qdict.o
CC qobject/qlist.o
CC qobject/qbool.o
CC qobject/qlit.o
CC qobject/qjson.o
CC qobject/qobject.o
CC qobject/json-lexer.o
CC qobject/json-streamer.o
CC qobject/json-parser.o
CC trace/control.o
CC trace/qmp.o
CC util/osdep.o
CC util/cutils.o
CC util/unicode.o
CC util/qemu-timer-common.o
CC util/bufferiszero.o
CC util/lockcnt.o
CC util/aiocb.o
CC util/async.o
CC util/thread-pool.o
CC util/qemu-timer.o
CC util/main-loop.o
CC util/iohandler.o
CC util/aio-posix.o
CC util/compatfd.o
CC util/event_notifier-posix.o
CC util/mmap-alloc.o
CC util/oslib-posix.o
CC util/qemu-openpty.o
CC util/qemu-thread-posix.o
CC util/memfd.o
util/memfd.c:40:12: error: static declaration of ‘memfd_create’ follows non-static declaration
static int memfd_create(const char *name, unsigned int flags)
^~~~~~~~~~~~
In file included from /usr/include/bits/mman-linux.h:117,
from /usr/include/bits/mman.h:49,
from /usr/include/sys/mman.h:41,
from /home/mobile_c/git/qemu-m68k/include/sysemu/os-posix.h:29,
from /home/mobile_c/git/qemu-m68k/include/qemu/osdep.h:104,
from util/memfd.c:28:
/usr/include/bits/mman-shared.h:46:5: note: previous declaration of ‘memfd_create’ was here
int memfd_create (const char *__name, unsigned int __flags) __THROW;
^~~~~~~~~~~~
make: *** [/home/mobile_c/git/qemu-m68k/rules.mak:66: util/memfd.o] Error 1
[ blackarch@mobile_c qemu-m68k ]$
-m 1000M
works. -m 1024M
doesn't.
-m 1015M
works. -m 1016M
doesn't.
I guess it is either not supported completly due to architecture limitations, or some memory is mapped incorrectly.
One option is to fix it, another (if it is arch issue), to refuse to start if the memory requrested is too big, or something.
-m 1281M
refuses to start:
qemu-system-m68k: /home/user/qemu-m68k/exec.c:1496: phys_section_add:
Assertion `map->sections_nb < TARGET_PAGE_SIZE' failed.
Aborted
-m 1280M
does start but crashes.
However, with -m 1200M
, it does work:
[ 0.000000] Memory: 1201636K/1228800K available (3026K kernel code, 396K rwdata,
856K rodata, 160K init, 203K bss, 27164K reserved, 0K cma-reserved)
and no crashes.
Tested with Linux 5.3.0-1 and Linux 4.19.0
Here are runs with -m 1024M, which are similar to runs with -m 1280M
.
Linux 5.3.0-1:
user@debian:~/qemu-m68k/system$ /usr/local/bin/qemu-system-m68k -M q800 -serial mon:stdio -m 1024M -drive file=m68k-system.img,format=qcow2 -drive file=m68k-swap.img,format=qcow2 -net nic,model=dp83932,addr=08:00:07:12:34:89 -net user -nographic -append "root=/dev/sda2 rw console=ttyS0" -cdrom debian-10.0-m68k-NETINST-1.iso -kernel vmlinux-5.3.0-1-m68k -initrd initrd.img-5.3.0-1-m68k
89 -net user -nographic -append "root=/dev/sda2 rw console=ttyS0" -cdrom debian-10.0-m68k-NETINST-1.iso -kernel
ABCFGHIJK
[ 0.000000] Linux version 5.3.0-1-m68k ([email protected]) (gcc version 9.2.1 20191016 (Debian 9.2.1-11)) #1 Debian 5.3.7-1 (2019-10-19)
[ 0.000000] Detected Macintosh model: 35
[ 0.000000] Apple Macintosh Quadra 800
[ 0.000000] initrd: 3f854000 - 3ffff891
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 259584
[ 0.000000] Kernel command line: root=/dev/sda2 rw console=ttyS0
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.000000] Sorting __ex_table...
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 1024088K/1048576K available (3026K kernel code, 396K rwdata, 856K rodata, 160K init, 203K bss, 24488K reserved, 0K cma-reserved)
[ 0.000000] random: get_random_u32 called from __kmem_cache_create+0x2c/0x45a with crng_init=0
[ 0.000000] SLUB: HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=8
[ 0.000000] NR_IRQS: 200
[ 0.000000] clocksource: via1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 2439823894983 ns
[ 0.010000] Console: colour dummy device 80x25
[ 0.010000] printk: console [ttyS0] enabled
[ 0.010000] Calibrating delay loop... 858.52 BogoMIPS (lpj=4292608)
[ 0.470000] pid_max: default: 32768 minimum: 301
[ 0.470000] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[ 0.470000] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[ 0.490000] devtmpfs: initialized
[ 0.500000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.500000] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[ 0.500000] NET: Registered protocol family 16
[ 0.530000] NuBus: Scanning NuBus slots.
[ 0.530000] Slot 9: Board resource not found!
[ 0.530000] SCSI subsystem initialized
[ 0.540000] clocksource: Switched to clocksource via1
[ 0.540000] VFS: Disk quotas dquot_6.6.0
[ 0.540000] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.550000] NET: Registered protocol family 2
[ 0.560000] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.560000] TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.560000] TCP bind hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.560000] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.560000] UDP hash table entries: 512 (order: 1, 8192 bytes, linear)
[ 0.560000] UDP-Lite hash table entries: 512 (order: 1, 8192 bytes, linear)
[ 0.560000] NET: Registered protocol family 1
[ 0.560000] NET: Registered protocol family 44
[ 0.570000] Trying to unpack rootfs image as initramfs...
[ 1.050000] Freeing initrd memory: 7852K
[ 1.060000] Key type blacklist registered
[ 1.060000] workingset: timestamp_bits=11 max_order=18 bucket_order=7
[ 1.070000] zbud: loaded
[ 1.070000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[ 1.070000] io scheduler mq-deadline registered
[ 1.080000] macfb: framebuffer at 0xf9001000, mapped to 0x(ptrval), size 468k
[ 1.080000] macfb: mode is 800x600x8, linelength=800
[ 1.080000] Console: switching to colour frame buffer device 100x37
[ 1.090000] fb0: DAFB frame buffer device
[ 1.090000] pmac_zilog: 0.6 (Benjamin Herrenschmidt <[email protected]>)
[ 1.090000] scc.0: ttyS0 at MMIO 0x5000c022 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port
[ 1.090000] scc.1: ttyS1 at MMIO 0x5000c020 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port
[ 1.090000] Non-volatile memory driver v1.3
[ 1.090000] adb: Mac II ADB Driver v1.0 for Unified ADB
[ 1.090000] mousedev: PS/2 mouse device common for all mice
[ 1.100000] Detected ADB keyboard, type <unknown>.
[ 1.100000] input: ADB keyboard as /devices/virtual/input/input0
[ 1.110000] random: fast init done
[ 1.110000] input: ADB mouse as /devices/virtual/input/input1
[ 1.110000] rtc-generic rtc-generic: registered as rtc0
[ 1.110000] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.110000] NET: Registered protocol family 17
[ 1.110000] mpls_gso: MPLS GSO support
[ 1.110000] registered taskstats version 1
[ 1.110000] zswap: loaded using pool lzo/zbud
[ 1.110000] rtc-generic rtc-generic: setting system clock to 2019-10-25T14:13:05 UTC (1572012785)
[ 1.120000] ------------[ cut here ]------------
[ 1.120000] WARNING: CPU: 0 PID: 1 at mm/vmalloc.c:153 vmap_page_range_noflush+0xea/0x19a
[ 1.120000] Modules linked in:
[ 1.120000] CPU: 0 PID: 1 Comm: swapper Not tainted 5.3.0-1-m68k #1 Debian 5.3.7-1
[ 1.120000] Stack from 3f45fc1c:
[ 1.120000] 3f45fc1c 0037ead8 0002ce06 40800000 40803000 003feb30 40803000 00000000
[ 1.120000] 00001680 00001084 0002ce2e 003823d9 00000099 000c5474 00000009 00000000
[ 1.120000] 00000000 003769c6 000c5474 003823d9 00000099 3e3b0920 00000dc0 00002dc2
[ 1.120000] ffffffff 00000400 00000003 40800000 000ca51c 002f1cd6 00000000 40802fff
[ 1.120000] 000c5544 40800000 40803000 00000039 3e3b0920 000c5590 40800000 40803000
[ 1.120000] 00000039 3e3b0920 3e257a20 000c6ef8 3e257a20 00000039 3e3b0920 3e3dd000
[ 1.120000] Call Trace: [<0002ce06>] __warn+0xc0/0xc2
[ 1.120000] [<00001680>] kernel_pg_dir+0x680/0x1000
[ 1.120000] [<00001084>] kernel_pg_dir+0x84/0x1000
[ 1.120000] [<0002ce2e>] warn_slowpath_null+0x26/0x2c
[ 1.120000] [<000c5474>] vmap_page_range_noflush+0xea/0x19a
[ 1.120000] [<000c5474>] vmap_page_range_noflush+0xea/0x19a
[ 1.120000] [<00002dc2>] module_finalize+0x16/0x1c
[ 1.120000] [<000ca51c>] __alloc_pages_nodemask+0x0/0x862
[ 1.120000] [<002f1cd6>] _cond_resched+0x0/0x2a
[ 1.120000] [<000c5544>] vmap_page_range+0x14/0x34
[ 1.120000] [<000c5590>] map_vm_area+0x2c/0x3a
[ 1.120000] [<000c6ef8>] __vmalloc_node_range+0xfe/0x1ca
[ 1.120000] [<002f1b48>] schedule+0x0/0x86
[ 1.120000] [<001c9b3c>] tty_free_file+0x0/0x16
[ 1.120000] [<001c9aec>] tty_add_file+0x0/0x50
[ 1.120000] [<001cedc6>] tty_ldisc_open.isra.0+0x0/0x50
[ 1.120000] [<000c70d6>] __vmalloc_node.constprop.0+0x3a/0x42
[ 1.120000] [<0000226e>] try_to_run_init_process+0x14/0x36
[ 1.120000] [<001cc2ea>] n_tty_open+0x12/0x7e
[ 1.120000] [<000c71aa>] vzalloc+0x1c/0x24
[ 1.120000] [<0000226e>] try_to_run_init_process+0x14/0x36
[ 1.120000] [<001cc2ea>] n_tty_open+0x12/0x7e
[ 1.120000] [<001cc2ea>] n_tty_open+0x12/0x7e
[ 1.120000] [<0000226e>] try_to_run_init_process+0x14/0x36
[ 1.120000] [<001cedc6>] tty_ldisc_open.isra.0+0x0/0x50
[ 1.120000] [<001cee02>] tty_ldisc_open.isra.0+0x3c/0x50
[ 1.120000] [<001cf3a4>] tty_ldisc_setup+0x18/0x44
[ 1.120000] [<002f2cb4>] mutex_unlock+0x0/0x2a
[ 1.120000] [<001cb08c>] tty_init_dev+0xfa/0x17a
[ 1.120000] [<001cb3c2>] tty_open+0x2b6/0x2c8
[ 1.120000] [<000e840a>] cdev_put+0x0/0x28
[ 1.120000] [<000e8546>] chrdev_open+0x114/0x120
[ 1.120000] [<000e8432>] chrdev_open+0x0/0x120
[ 1.120000] [<000e1f70>] do_dentry_open+0x270/0x2b6
[ 1.130000] [<000e2bc4>] vfs_open+0x26/0x2c
[ 1.130000] [<000f0dd6>] path_openat+0xa2a/0xb34
[ 1.130000] [<00002096>] do_one_initcall+0x0/0x184
[ 1.130000] [<000f03ac>] path_openat+0x0/0xb34
[ 1.130000] [<001ea7ce>] dev_printk_emit+0x1a/0x22
[ 1.130000] [<000f0f12>] do_filp_open+0x32/0x76
[ 1.130000] [<000fa188>] __alloc_fd+0xdc/0x23a
[ 1.130000] [<00002096>] do_one_initcall+0x0/0x184
[ 1.130000] [<000fa300>] get_unused_fd_flags+0x1a/0x20
[ 1.130000] [<000e2e8e>] do_sys_open+0x11c/0x1a4
[ 1.130000] [<0003fde8>] parse_args+0x0/0x2c8
[ 1.130000] [<00002096>] do_one_initcall+0x0/0x184
[ 1.130000] [<00020000>] _FP_CALL_TOP+0x8f66/0xd512
[ 1.130000] [<002eade2>] strcpy+0x0/0x1c
[ 1.130000] [<004340c6>] kernel_init_freeable+0x10e/0x18c
[ 1.130000] [<002f0c8a>] kernel_init+0x0/0xd2
[ 1.130000] [<002f0c92>] kernel_init+0x8/0xd2
[ 1.130000] [<002f0c8a>] kernel_init+0x0/0xd2
[ 1.130000] [<00002934>] ret_from_kernel_thread+0xc/0x14
[ 1.130000] ---[ end trace a29e3786ea8b1630 ]---
[ 1.130000] swapper: vmalloc: allocation failure, allocated 12288 of 16384 bytes, mode:0xdc0(GFP_KERNEL|__GFP_ZERO), nodemask=(null)
[ 1.130000] CPU: 0 PID: 1 Comm: swapper Tainted: G W 5.3.0-1-m68k #1 Debian 5.3.7-1
[ 1.130000] Stack from 3f45fc90:
[ 1.130000] 3f45fc90 0037ead8 000ca430 0000000c 00000dc0 00002dc2 3e257a20 000ca51c
[ 1.130000] 3f45fcd0 00382511 3f45fcb0 00000000 000c6f82 00000dc0 00000000 00382511
[ 1.130000] 00003000 00004000 3e3dd000 00000000 002f1b48 00000002 001c9b3c 001c9aec
[ 1.130000] 3e3dd11a 3e3dd000 001cedc6 000c70d6 0000226e 00000001 40800000 d0000000
[ 1.130000] 00000dc0 00000039 00000000 ffffffff 001cc2ea 000c71aa 0000226e 00000dc0
[ 1.130000] 00000039 ffffffff 001cc2ea 001cc2ea 0000226e 3e3dd11a 00000000 001cedc6
[ 1.130000] Call Trace: [<000ca430>] warn_alloc+0x88/0x10e
[ 1.130000] [<00002dc2>] module_finalize+0x16/0x1c
[ 1.130000] [<000ca51c>] __alloc_pages_nodemask+0x0/0x862
[ 1.130000] [<000c6f82>] __vmalloc_node_range+0x188/0x1ca
[ 1.130000] [<00003000>] copy_thread+0x8c/0xee
[ 1.130000] [<00004000>] setup_rt_frame+0x402/0x4f2
[ 1.130000] [<002f1b48>] schedule+0x0/0x86
[ 1.130000] [<001c9b3c>] tty_free_file+0x0/0x16
[ 1.130000] [<001c9aec>] tty_add_file+0x0/0x50
[ 1.130000] [<001cedc6>] tty_ldisc_open.isra.0+0x0/0x50
[ 1.130000] [<000c70d6>] __vmalloc_node.constprop.0+0x3a/0x42
[ 1.130000] [<0000226e>] try_to_run_init_process+0x14/0x36
[ 1.130000] [<001cc2ea>] n_tty_open+0x12/0x7e
[ 1.130000] [<000c71aa>] vzalloc+0x1c/0x24
[ 1.130000] [<0000226e>] try_to_run_init_process+0x14/0x36
[ 1.130000] [<001cc2ea>] n_tty_open+0x12/0x7e
[ 1.130000] [<001cc2ea>] n_tty_open+0x12/0x7e
[ 1.130000] [<0000226e>] try_to_run_init_process+0x14/0x36
[ 1.130000] [<001cedc6>] tty_ldisc_open.isra.0+0x0/0x50
[ 1.130000] [<001cee02>] tty_ldisc_open.isra.0+0x3c/0x50
[ 1.130000] [<001cf3a4>] tty_ldisc_setup+0x18/0x44
[ 1.130000] [<002f2cb4>] mutex_unlock+0x0/0x2a
[ 1.130000] [<001cb08c>] tty_init_dev+0xfa/0x17a
[ 1.130000] [<001cb3c2>] tty_open+0x2b6/0x2c8
[ 1.130000] [<000e840a>] cdev_put+0x0/0x28
[ 1.130000] [<000e8546>] chrdev_open+0x114/0x120
[ 1.140000] [<000e8432>] chrdev_open+0x0/0x120
[ 1.140000] [<000e1f70>] do_dentry_open+0x270/0x2b6
[ 1.140000] [<000e2bc4>] vfs_open+0x26/0x2c
[ 1.140000] [<000f0dd6>] path_openat+0xa2a/0xb34
[ 1.140000] [<00002096>] do_one_initcall+0x0/0x184
[ 1.140000] [<000f03ac>] path_openat+0x0/0xb34
[ 1.140000] [<001ea7ce>] dev_printk_emit+0x1a/0x22
[ 1.140000] [<000f0f12>] do_filp_open+0x32/0x76
[ 1.140000] [<000fa188>] __alloc_fd+0xdc/0x23a
[ 1.140000] [<00002096>] do_one_initcall+0x0/0x184
[ 1.140000] [<000fa300>] get_unused_fd_flags+0x1a/0x20
[ 1.140000] [<000e2e8e>] do_sys_open+0x11c/0x1a4
[ 1.140000] [<0003fde8>] parse_args+0x0/0x2c8
[ 1.140000] [<00002096>] do_one_initcall+0x0/0x184
[ 1.140000] [<00020000>] _FP_CALL_TOP+0x8f66/0xd512
[ 1.140000] [<002eade2>] strcpy+0x0/0x1c
[ 1.140000] [<004340c6>] kernel_init_freeable+0x10e/0x18c
[ 1.140000] [<002f0c8a>] kernel_init+0x0/0xd2
[ 1.140000] [<002f0c92>] kernel_init+0x8/0xd2
[ 1.140000] [<002f0c8a>] kernel_init+0x0/0xd2
[ 1.140000] [<00002934>] ret_from_kernel_thread+0xc/0x14
[ 1.140000] Mem-Info:
[ 1.140000] active_anon:0 inactive_anon:0 isolated_anon:0
[ 1.140000] active_file:0 inactive_file:0 isolated_file:0
[ 1.140000] unevictable:4725 dirty:0 writeback:0 unstable:0
[ 1.140000] slab_reclaimable:106 slab_unreclaimable:295
[ 1.140000] mapped:0 shmem:0 pagetables:0 bounce:0
[ 1.140000] free:252275 free_pcp:465 free_cma:0
[ 1.140000] Node 0 active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:18900kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:0kB writeback:0kB shmem:0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
[ 1.140000] DMA free:1009100kB min:4044kB low:5068kB high:6092kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:18900kB writepending:0kB present:1048576kB managed:1031940kB mlocked:0kB kernel_stack:184kB pagetables:0kB bounce:0kB free_pcp:1860kB local_pcp:1860kB free_cma:0kB
[ 1.140000] lowmem_reserve[]: 0 0 0
[ 1.140000] DMA: 3*4kB (UM) 4*8kB (UME) 2*16kB (ME) 2*32kB (UE) 1*64kB (E) 0*128kB 3*256kB (UME) 3*512kB (UM) 3*1024kB (UME) 4*2048kB (UME) 243*4096kB (M) = 1009100kB
[ 1.140000] 4736 total pagecache pages
[ 1.140000] 0 pages in swap cache
[ 1.140000] Swap cache stats: add 0, delete 0, find 0/0
[ 1.140000] Free swap = 0kB
[ 1.140000] Total swap = 0kB
[ 1.140000] 262144 pages RAM
[ 1.140000] 0 pages HighMem/MovableOnly
[ 1.140000] 4159 pages reserved
[ 1.140000] ttyS ttyS0: ldisc open failed (-12), clearing slot 0
[ 1.140000] Warning: unable to open an initial console.
[ 1.140000] Freeing unused kernel memory: 160K
[ 1.140000] This architecture does not have kernel memory protection.
[ 1.140000] Run /init as init process
[ 1.410000] systemd-udevd[71]: Starting version 242
[ 1.420000] systemd-udevd[71]: Assertion 'close_nointr(fd) != -EBADF' failed at ../src/basic/fd-util.c:71, function safe_close(). Aborting.
[ 1.450000] systemd-udevd[72]: Failed to start device monitor: Operation not permitted
[ 1.450000] systemd-udevd[72]: Assertion 'close_nointr(fd) != -EBADF' failed at ../src/basic/fd-util.c:71, function safe_close(). Aborting.
...
(after few seconds kernel starts outputing trillions of faults)
....
Linux 4.19.0:
user@debian:~/qemu-m68k/system$ /usr/local/bin/qemu-system-m68k -M q800 -serial none -serial mon:stdio -m 1024M -drive file=m68k-system.img,format=qcow2 -drive file=m68k-swap.img,format=qcow2 -net nic,model=dp83932,addr=08:00:07:12:34:89 -net user -nographic -append "root=/dev/ram rw console=ttyS0" -cdrom debian-10.0-m68k-NETINST-1.iso -kernel vmlinux-4.19.0-5-m68k -initrd initrd.gz
ABCFGHIJK
[ 0.000000] Linux version 4.19.0-5-m68k ([email protected]) (gcc version 8.3.0 (Debian 8.3.0-7)) #1 Debian 4.19.37-5 (2019-06-19)
[ 0.000000] Detected Macintosh model: 35
[ 0.000000] Apple Macintosh Quadra 800
[ 0.000000] initrd: 3f74f000 - 3ffff5b3
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 259584
[ 0.000000] Kernel command line: root=/dev/ram rw console=ttyS0
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Sorting __ex_table...
[ 0.000000] Memory: 1023056K/1048576K available (2870K kernel code, 399K rwdata, 1004K rodata, 156K init, 202K bss, 25520K reserved, 0K cma-reserved)
[ 0.000000] random: get_random_u32 called from __kmem_cache_create+0x2c/0x498 with crng_init=0
[ 0.000000] SLUB: HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=8
[ 0.000000] NR_IRQS: 200
[ 0.000000] Console: colour dummy device 80x25
[ 0.000000] console [ttyS0] enabled
[ 0.140000] Calibrating delay loop... 858.52 BogoMIPS (lpj=4292608)
[ 0.150000] pid_max: default: 32768 minimum: 301
[ 0.150000] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.150000] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.170000] devtmpfs: initialized
[ 0.180000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.180000] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.180000] NET: Registered protocol family 16
[ 0.190000] NuBus: Scanning NuBus slots.
[ 0.190000] Slot 9: Board resource not found!
[ 0.200000] SCSI subsystem initialized
[ 0.200000] VFS: Disk quotas dquot_6.6.0
[ 0.200000] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.220000] NET: Registered protocol family 2
[ 0.220000] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[ 0.220000] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.220000] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.220000] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.220000] UDP hash table entries: 512 (order: 1, 8192 bytes)
[ 0.220000] UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
[ 0.220000] NET: Registered protocol family 1
[ 0.220000] NET: Registered protocol family 44
[ 0.230000] Unpacking initramfs...
[ 0.710000] Freeing initrd memory: 8896K
[ 0.710000] Key type blacklist registered
[ 0.710000] workingset: timestamp_bits=11 max_order=18 bucket_order=7
[ 0.720000] zbud: loaded
[ 1.600000] ------------[ cut here ]------------
[ 1.600000] WARNING: CPU: 0 PID: 29 at mm/vmalloc.c:150 vmap_page_range_noflush+0xea/0x19c
[ 1.600000] Modules linked in:
[ 1.600000] CPU: 0 PID: 29 Comm: cryptomgr_test Not tainted 4.19.0-5-m68k #1 Debian 4.19.37-5
[ 1.600000] Stack from 3d53dc7c:
[ 1.600000] 3d53dc7c 003a387a 0002c46e 40800000 40820000 003fdb24 40820000 00000000
[ 1.600000] 00001680 00001084 0002c496 003766de 00000096 000be2ce 00000009 00000000
[ 1.600000] 00000000 0036bb5a 000be2ce 003766de 00000096 3f0b8880 006000c0 00000020
[ 1.600000] 006002c2 00000000 00200000 40800000 0009a832 002caf86 0004b650 4081ffff
[ 1.600000] 000be3a0 40800000 40820000 00000039 3f0b8880 000be3ec 40800000 40820000
[ 1.600000] 00000039 3f0b8880 3e9bdf80 000bf1fe 3e9bdf80 00000039 3f0b8880 3d516800
[ 1.600000] Call Trace: [<0002c46e>] __warn+0xc0/0xc2
[ 1.600000] [<00001680>] kernel_pg_dir+0x680/0x1000
[ 1.600000] [<00001084>] kernel_pg_dir+0x84/0x1000
[ 1.600000] [<0002c496>] warn_slowpath_null+0x26/0x2c
[ 1.600000] [<000be2ce>] vmap_page_range_noflush+0xea/0x19c
[ 1.600000] [<000be2ce>] vmap_page_range_noflush+0xea/0x19c
[ 1.600000] [<00200000>] input_default_getkeycode+0x6/0x70
[ 1.600000] [<0009a832>] __alloc_pages_nodemask+0x0/0x7ea
[ 1.600000] [<002caf86>] _cond_resched+0x0/0x2a
[ 1.600000] [<0004b650>] complete+0x0/0x34
[ 1.600000] [<000be3a0>] vmap_page_range+0x14/0x34
[ 1.600000] [<000be3ec>] map_vm_area+0x2c/0x3a
[ 1.600000] [<000bf1fe>] __vmalloc_node_range+0xf8/0x1c0
[ 1.600000] [<000bf300>] __vmalloc_node+0x3a/0x42
[ 1.600000] [<00020000>] _FP_CALL_TOP+0x954a/0xd512
[ 1.600000] [<0014d63e>] crypto_scomp_alloc_scratches+0x26/0x42
[ 1.610000] [<000bf410>] vmalloc_node+0x22/0x2a
[ 1.610000] [<00020000>] _FP_CALL_TOP+0x954a/0xd512
[ 1.610000] [<0014d63e>] crypto_scomp_alloc_scratches+0x26/0x42
[ 1.610000] [<0014d63e>] crypto_scomp_alloc_scratches+0x26/0x42
[ 1.610000] [<00020000>] _FP_CALL_TOP+0x954a/0xd512
[ 1.610000] [<0014d618>] crypto_scomp_alloc_scratches+0x0/0x42
[ 1.610000] [<0014d69e>] crypto_scomp_init_tfm+0x44/0x6c
[ 1.610000] [<00146aa4>] crypto_create_tfm+0x3e/0x8e
[ 1.610000] [<0014d6ee>] crypto_init_scomp_ops_async+0x28/0x76
[ 1.610000] [<00146aa4>] crypto_create_tfm+0x3e/0x8e
[ 1.610000] [<00147000>] crypto_find_alg+0x0/0x3a
[ 1.610000] [<00146a66>] crypto_create_tfm+0x0/0x8e
[ 1.610000] [<001468e0>] crypto_mod_put+0x0/0x2e
[ 1.610000] [<001470a0>] crypto_alloc_tfm+0x66/0x78
[ 1.610000] [<0014db80>] alg_find_test+0x0/0x50
[ 1.610000] [<0002daba>] do_exit+0x0/0x808
[ 1.610000] [<0014d140>] crypto_alloc_acomp+0x18/0x20
[ 1.610000] [<0015063a>] alg_test_comp+0x30/0x700
[ 1.610000] [<0014db80>] alg_find_test+0x0/0x50
[ 1.610000] [<0002daba>] do_exit+0x0/0x808
[ 1.610000] [<0004b650>] complete+0x0/0x34
[ 1.610000] [<00047a00>] enqueue_entity+0x0/0x370
[ 1.610000] [<00046762>] __enqueue_entity+0x3c/0x6a
[ 1.610000] [<00047c3c>] enqueue_entity+0x23c/0x370
[ 1.610000] [<00002704>] calibrate_delay+0xbe/0x18a
[ 1.610000] [<00002704>] calibrate_delay+0xbe/0x18a
[ 1.610000] [<002c04c6>] rb_erase_cached+0x28/0x2e6
[ 1.610000] [<001504a6>] alg_test.part.1+0x1de/0x206
[ 1.610000] [<0004ab6c>] __init_waitqueue_head+0x0/0xc
[ 1.610000] [<0014db34>] cryptomgr_test+0x0/0x48
[ 1.610000] [<0002daba>] do_exit+0x0/0x808
[ 1.610000] [<0004b650>] complete+0x0/0x34
[ 1.610000] [<000479c8>] pick_next_task_fair+0xf8/0x130
[ 1.610000] [<0004ab6c>] __init_waitqueue_head+0x0/0xc
[ 1.610000] [<0014db34>] cryptomgr_test+0x0/0x48
[ 1.610000] [<002cac2a>] __schedule+0x272/0x464
[ 1.610000] [<0004ab6c>] __init_waitqueue_head+0x0/0xc
[ 1.610000] [<0014db34>] cryptomgr_test+0x0/0x48
[ 1.610000] [<002ca9b8>] __schedule+0x0/0x464
[ 1.610000] [<0002daba>] do_exit+0x0/0x808
[ 1.610000] [<002cae68>] schedule+0x4c/0x68
[ 1.610000] [<0014db56>] cryptomgr_test+0x22/0x48
[ 1.610000] [<0003f446>] kthread+0xdc/0xe6
[ 1.610000] [<0003f36a>] kthread+0x0/0xe6
[ 1.610000] [<000028a0>] ret_from_kernel_thread+0xc/0x14
[ 1.610000] ---[ end trace 1c2fe94225ffa29c ]---
[ 1.610000] cryptomgr_test: vmalloc: allocation failure, allocated 131072 of 135168 bytes, mode:0x6000c0(GFP_KERNEL), nodemask=(null)
[ 1.610000] CPU: 0 PID: 29 Comm: cryptomgr_test Tainted: G W 4.19.0-5-m68k #1 Debian 4.19.37-5
[ 1.610000] Stack from 3d53dcd8:
[ 1.610000] 3d53dcd8 003a387a 0009a74c 003741b8 3f063194 3d53dd14 006000c0 3d53dd24
[ 1.610000] 00000000 00000000 3f0b8880 006000c0 00000020 3e9bdf80 3d53dd30 00376816
[ 1.610000] 3d53dd10 0004b650 000bf282 006000c0 00000000 00376816 00020000 00021000
[ 1.610000] 3d516800 3f0b5740 002ddfe8 00000400 ffffffff 00000081 00f75a8c 003e90d0
[ 1.610000] 002de014 000bf300 00020000 00000001 40800000 d0000000 006000c0 00000039
[ 1.610000] 00000000 00000000 0014d63e 000bf410 00020000 00000001 006000c0 00000039
[ 1.610000] Call Trace: [<0009a74c>] warn_alloc+0x7a/0xfa
[ 1.610000] [<0004b650>] complete+0x0/0x34
[ 1.610000] [<000bf282>] __vmalloc_node_range+0x17c/0x1c0
[ 1.610000] [<00020000>] _FP_CALL_TOP+0x954a/0xd512
[ 1.610000] [<00021000>] _FP_CALL_TOP+0xa54a/0xd512
[ 1.610000] [<000bf300>] __vmalloc_node+0x3a/0x42
[ 1.610000] [<00020000>] _FP_CALL_TOP+0x954a/0xd512
[ 1.610000] [<0014d63e>] crypto_scomp_alloc_scratches+0x26/0x42
[ 1.610000] [<000bf410>] vmalloc_node+0x22/0x2a
[ 1.610000] [<00020000>] _FP_CALL_TOP+0x954a/0xd512
[ 1.620000] [<0014d63e>] crypto_scomp_alloc_scratches+0x26/0x42
[ 1.620000] [<0014d63e>] crypto_scomp_alloc_scratches+0x26/0x42
[ 1.620000] [<00020000>] _FP_CALL_TOP+0x954a/0xd512
[ 1.620000] [<0014d618>] crypto_scomp_alloc_scratches+0x0/0x42
[ 1.620000] [<0014d69e>] crypto_scomp_init_tfm+0x44/0x6c
[ 1.620000] [<00146aa4>] crypto_create_tfm+0x3e/0x8e
[ 1.620000] [<0014d6ee>] crypto_init_scomp_ops_async+0x28/0x76
[ 1.620000] [<00146aa4>] crypto_create_tfm+0x3e/0x8e
[ 1.620000] [<00147000>] crypto_find_alg+0x0/0x3a
[ 1.620000] [<00146a66>] crypto_create_tfm+0x0/0x8e
[ 1.620000] [<001468e0>] crypto_mod_put+0x0/0x2e
[ 1.620000] [<001470a0>] crypto_alloc_tfm+0x66/0x78
[ 1.620000] [<0014db80>] alg_find_test+0x0/0x50
[ 1.620000] [<0002daba>] do_exit+0x0/0x808
[ 1.620000] [<0014d140>] crypto_alloc_acomp+0x18/0x20
[ 1.620000] [<0015063a>] alg_test_comp+0x30/0x700
[ 1.620000] [<0014db80>] alg_find_test+0x0/0x50
[ 1.620000] [<0002daba>] do_exit+0x0/0x808
[ 1.620000] [<0004b650>] complete+0x0/0x34
[ 1.620000] [<00047a00>] enqueue_entity+0x0/0x370
[ 1.620000] [<00046762>] __enqueue_entity+0x3c/0x6a
[ 1.620000] [<00047c3c>] enqueue_entity+0x23c/0x370
[ 1.620000] [<00002704>] calibrate_delay+0xbe/0x18a
[ 1.620000] [<00002704>] calibrate_delay+0xbe/0x18a
[ 1.620000] [<002c04c6>] rb_erase_cached+0x28/0x2e6
[ 1.620000] [<001504a6>] alg_test.part.1+0x1de/0x206
[ 1.620000] [<0004ab6c>] __init_waitqueue_head+0x0/0xc
[ 1.620000] [<0014db34>] cryptomgr_test+0x0/0x48
[ 1.620000] [<0002daba>] do_exit+0x0/0x808
[ 1.620000] [<0004b650>] complete+0x0/0x34
[ 1.620000] [<000479c8>] pick_next_task_fair+0xf8/0x130
[ 1.620000] [<0004ab6c>] __init_waitqueue_head+0x0/0xc
[ 1.620000] [<0014db34>] cryptomgr_test+0x0/0x48
[ 1.620000] [<002cac2a>] __schedule+0x272/0x464
[ 1.620000] [<0004ab6c>] __init_waitqueue_head+0x0/0xc
[ 1.620000] [<0014db34>] cryptomgr_test+0x0/0x48
[ 1.620000] [<002ca9b8>] __schedule+0x0/0x464
[ 1.620000] [<0002daba>] do_exit+0x0/0x808
[ 1.620000] [<002cae68>] schedule+0x4c/0x68
[ 1.620000] [<0014db56>] cryptomgr_test+0x22/0x48
[ 1.620000] [<0003f446>] kthread+0xdc/0xe6
[ 1.620000] [<0003f36a>] kthread+0x0/0xe6
[ 1.620000] [<000028a0>] ret_from_kernel_thread+0xc/0x14
[ 1.620000] Mem-Info:
[ 1.620000] active_anon:0 inactive_anon:0 isolated_anon:0
[ 1.620000] active_file:0 inactive_file:0 isolated_file:0
[ 1.620000] unevictable:6090 dirty:0 writeback:0 unstable:0
[ 1.620000] slab_reclaimable:189 slab_unreclaimable:238
[ 1.620000] mapped:0 shmem:0 pagetables:0 bounce:0
[ 1.620000] free:251002 free_pcp:340 free_cma:0
[ 1.620000] Node 0 active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:24360kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:0kB writeback:0kB shmem:0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
[ 1.620000] DMA free:1004008kB min:4044kB low:5064kB high:6084kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:24360kB writepending:0kB present:1048576kB managed:1031952kB mlocked:0kB kernel_stack:144kB pagetables:0kB bounce:0kB free_pcp:1360kB local_pcp:1360kB free_cma:0kB
[ 1.620000] lowmem_reserve[]: 0 0 0
[ 1.620000] DMA: 2*4kB (UM) 2*8kB (UE) 3*16kB (ME) 1*32kB (E) 2*64kB (ME) 0*128kB 3*256kB (UM) 3*512kB (UM) 2*1024kB (ME) 4*2048kB (UME) 242*4096kB (M) = 1004008kB
[ 1.620000] 6104 total pagecache pages
[ 1.620000] 0 pages in swap cache
[ 1.630000] Swap cache stats: add 0, delete 0, find 0/0
[ 1.630000] Free swap = 0kB
[ 1.630000] Total swap = 0kB
[ 1.630000] 262144 pages RAM
[ 1.630000] 0 pages HighMem/MovableOnly
[ 1.630000] 4156 pages reserved
[ 1.630000] alg: acomp: Failed to load transform for lzo-scomp: -12
[ 1.630000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[ 1.630000] io scheduler noop registered
[ 1.630000] io scheduler cfq registered (default)
[ 1.630000] io scheduler mq-deadline registered
[ 1.630000] atafb_init: start
[ 1.630000] macfb: framebuffer at 0xf9001000, mapped to 0x(ptrval), size 468k
[ 1.630000] macfb: mode is 800x600x8, linelength=800
[ 1.640000] Console: switching to colour frame buffer device 100x37
[ 1.640000] fb0: DAFB frame buffer device
[ 1.640000] pmac_zilog: 0.6 (Benjamin Herrenschmidt <[email protected]>)
[ 1.640000] scc.0: ttyS0 at MMIO 0x5000c022 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port
[ 1.640000] scc.1: ttyS1 at MMIO 0x5000c020 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port
[ 1.640000] adb: Mac II ADB Driver v1.0 for Unified ADB
[ 1.650000] random: fast init done
[ 1.650000] ADB keyboard at 2, handler 1
[ 1.650000] Detected ADB keyboard, type <unknown>.
[ 1.650000] input: ADB keyboard as /devices/virtual/input/input0
[ 1.650000] ADB mouse at 3, handler 1
[ 1.650000] input: ADB mouse as /devices/virtual/input/input1
[ 1.660000] mousedev: PS/2 mouse device common for all mice
[ 1.660000] rtc-generic rtc-generic: rtc core: registered rtc-generic as rtc0
[ 1.660000] ledtrig-cpu: registered to indicate activity on CPUs
[ 1.660000] NET: Registered protocol family 17
[ 1.660000] mpls_gso: MPLS GSO support
[ 1.660000] registered taskstats version 1
[ 1.660000] zswap: loaded using pool lzo/zbud
[ 1.660000] rtc-generic rtc-generic: setting system clock to 2019-10-25 14:14:23 UTC (1572012863)
[ 1.670000] ------------[ cut here ]------------
[ 1.670000] WARNING: CPU: 0 PID: 1 at mm/vmalloc.c:150 vmap_page_range_noflush+0xea/0x19c
...
...
many more failures
...
Just updated master-dev to git 5e79823 and tried to build apt in a fresh unstable chroot which previously failed with timeouts when running /usr/bin/msgmerge:
Generating ../build/po/domains/apt/ast.po echo ../build/po/domains/apt/ast.po : ast.po ../build/po/apt.pot > ../build/po/apt_ast.po.d
/usr/bin//msgmerge --add-location=file ast.po ../build/po/apt.pot -o ../build/po/domains/apt/ast.po
............E: Caught signal ‘Terminated’: terminating immediately
make[2]: *** wait: No child processes. Stop.
make[2]: *** Waiting for unfinished jobs....
make[2]: *** wait: No child processes. Stop.
make[1]: *** wait: No child processes. Stop.
make[1]: *** Waiting for unfinished jobs....
make[1]: *** wait: No child processes. Stop.
make: *** wait: No child processes. Stop.
make: *** Waiting for unfinished jobs....
make: *** wait: No child processes. Stop.
Build killed with signal TERM after 30 minutes of inactivity
The build still fails, but this time not with a timeout but with an illegal instruction:
Generating ../build/po/domains/apt/ar.po echo ../build/po/domains/apt/ar.po : ar.po ../build/po/apt.pot > ../build/po/apt_ar.po.d
/usr/bin//msgmerge --add-location=file ar.po ../build/po/apt.pot -o ../build/po/domains/apt/ar.po
qemu: fatal: Illegal instruction: 2f0a @ f615cd26
D0 = 00000004 A0 = 80093c70 F0 = 7fff 4000000000000000
D1 = 00000000 A1 = 80015150 F1 = 7fff 4000000000000000
D2 = f6fff428 A2 = f42ff91c F2 = 7fff 4000000000000000
D3 = 80093c84 A3 = 80003bf0 F3 = 7fff 4000000000000000
D4 = f42ff400 A4 = f6fff22c F4 = 7fff 4000000000000000
D5 = 00001000 A5 = f6168000 F5 = 7fff 4000000000000000
D6 = f614b3e0 A6 = f42feef0 F6 = 7fff 4000000000000000
D7 = 00800000 A7 = f42feed0 F7 = 7fff 4000000000000000
PC = f615cd22 SR = 0008 -N--- makefile:60: recipe for target '../build/po/domains/apt/ar.po' failed
Attaching the build log.
After a fresh bootstrap of fpc
for m68k, trying to run ppc68k
in qemu-m68k:
(sid-m68k-sbuild)root@stretch64:/# ./usr/lib/fpc/3.1.1/ppc68k
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
Illegal instruction
(sid-m68k-sbuild)root@stretch64:/#
The binary works fine on Aranym:
root@mama:~# ./ppc68k
Free Pascal Compiler version 3.1.1 [2017/05/28] for m68k
Copyright (c) 1993-2017 by Florian Klaempfl and others
/root/ppc68k [options] <inputfile> [options]
Put + after a boolean switch option to enable it, - to disable it.
@<x> Read compiler options from <x> in addition to the default fpc.cfg
-a The compiler does not delete the generated assembler file
-a5 Don't generate Big Obj COFF files for GNU Binutils older than 2.25 (Windows, NativeNT)
-al List sourcecode lines in assembler file
-an List node info in assembler file (-dEXTDEBUG compiler)
-ao Add an extra option to external assembler call (ignored for internal)
-ap Use pipes instead of creating temporary assembler files
-ar List register allocation/release info in assembler file
-at List temp allocation/release info in assembler file
-A<x> Output format:
-Adefault Use default assembler
-Aas Unix o-file using GNU AS
-Agas GNU Motorola assembler
-Amit MIT Syntax (old GAS)
-Amot Standard Motorola assembler
*** press enter ***
(...)
root@mama:~#
The offending binary can be found here:
https://people.debian.org/~glaubitz/ppc68k
fpc
for m68k can be built on Debian with:
$ apt build-dep fpc
$ BINUTILSPREFIX=m68k-linux-gnu- make crossall crossinstall CPU_TARGET=m68k OS_TARGET=linux FPC=/usr/lib/fpc/3.0.0/ppcx64 INSTALL_PREFIX=/root/fpc-m68k/
$ BINUTILSPREFIX=m68k-linux-gnu- make compiler CPU_TARGET=m68k OS_TARGET=linux FPC=/root/fpc-m68k/lib/fpc/3.1.1/ppcross68k CROSSOPT="-Fu/root/fpc-m68k/lib/fpc/3.1.1/units/*"
With git 5e79823 from master-dev, trying to build razorqt in an up-to-date unstable m68k chroot, the build fails when trying to run qt5's user-interface compiler (uic):
cd /<>/obj-m68k-linux-gnu/razorqt-panel/plugin-cpuload && /usr/lib/m68k-linux-gnu/qt4/bin/uic -o /<>/obj-m68k-linux-gnu/razorqt-panel/plugin-cpuload/ui_razorcpuloadconfiguration.h /<>/razorqt-panel/plugin-cpuload/razorcpuloadconfiguration.ui
qemu: fatal: Unimplemented: fmove from control 7
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
Attaching the build log.
The underlying issue has been discussed in a previous private discussion with Michael Karcher:
Le 12/12/2015 16:53, Michael Karcher a écrit :
On 12.12.2015 13:08, Laurent Vivier wrote:
Le 12/12/2015 09:56, John Paul Adrian Glaubitz a écrit :
qt4-x11 [2]:
make[3]: Entering directory '/«BUILDDIR»/qt4-x11-4.8.7+dfsg/src/gui'
[...]
/«BUILDDIR»/qt4-x11-4.8.7+dfsg/bin/uic dialogs/qpagesetupwidget.ui -o
.uic/release-shared/ui_qpagesetupwidget.h
qemu: fatal: Unimplemented: fmove from control 7
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Can I have the instruction opcode ?Valid control register values are only 1, 2, 4, so I assume this
instruction is not decoded correctly.
It seems that it actually is a bit mask, and 7 means "all of them". Have
a look at the gdb output:(sid-m68k-sbuild)/tmp/qt4-x11-4.8.7+dfsg/src/gui# gdb ../../bin/uic qemu_uic_20151212-154524_27519.core
GNU gdb (Debian 7.10-1) 7.10
[...]
Core was generated by `../../bin/uic dialogs/qpagesetupwidget.ui -o .uic/release-shared/ui_qpagesetupw'.
Program terminated with signal SIGSEGV, Segmentation fault.0 __GI___feholdexcept (envp=0xf6ffe230) at ../sysdeps/m68k/fpu/feholdexcpt.c:24
24 ../sysdeps/m68k/fpu/feholdexcpt.c: No such file or directory.
(gdb) x/5i $pc
=> 0xf663ab94 <__GI___feholdexcept>: linkw %fp,#0
0xf663ab98 <__GI___feholdexcept+4>: moveal %fp@(8),%a0
0xf663ab9c <__GI___feholdexcept+8>: fmoveml %fpiar/%fpsr/%fpcr,%a0@
0xf663aba0 <__GI___feholdexcept+12>: moveq #-8,%d0
0xf663aba2 <__GI___feholdexcept+14>: notb %d0
(gdb) x/2hx $pc + 8
0xf663ab9c <__GI___feholdexcept+8>: 0xf210 0xbc00
(gdb)
Again, you're right
The documentation says "Moves the contents of a floating-point system
control register", not "some"...
The recent revision of the m68k-dev has introduced a regression with GHC:
configure: Building in-tree ghc-pwd
/root/qemu-m68k/tcg/tcg.c:2532: tcg fatal error
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
./configure: line 4244: 1687 Segmentation fault "$WithGhc" $GHC_LDFLAGS -v0 -no-user-$GHC_PACKAGE_DB_FLAG -hidir utils/ghc-pwd/dist-boot -odir utils/ghc-pwd/dist-boot
-stubdir utils/ghc-pwd/dist-boot --make utils/ghc-pwd/Main.hs -o utils/ghc-pwd/dist-boot/ghc-pwd
configure: error: Building ghc-pwd failed
My last version qemu-m68k-static.20171228
works fine, so this is another regression.
qemu-system-m68k cannot load a current NetBSD 7.1 kernel from the -kernel command line option unlike standard qemu for other architectures.
Using qemu-system-m68k version 2.11.90 I get the following error on an unzipped kernel: "Trying to execute code outside RAM or ROM at 0x00002e00"
Regular qemu allows you to boot NetBSD's kernel directly from the command line on other architectures, such as ARM and x86. The kernel is multiboot compliant.
Supporting NetBSD would be really helpful because the system is currently maintained and has a long history 68k Macs. Hopefully this is not out of scope for qemu-m68k.
gcc 9.2.1
LINK m68k-softmmu/qemu-system-m68k
/home/user/qemu-m68k/target/m68k/op_helper.c:39:13: error: type of ‘qemu_system_reset_request’ does not match original declaration [-Werror=lto-type-mismatch]
39 | extern void qemu_system_reset_request(void);
| ^
vl.c:1611:6: note: type mismatch in parameter 1
vl.c:1611:6: note: type ‘ShutdownCause’ should match type ‘void’
vl.c:1611:6: note: ‘qemu_system_reset_request’ was previously declared here
lto1: all warnings being treated as errors
For reference vlc.:1611
:
void qemu_system_reset_request(ShutdownCause reason)
{
...
QEMU symptoms look like "DOUBLE MMU FAULT" or a SIGABORT.
I'm fairly sure that the same bug sometimes shows up as a Linux kernel Oops in skb_release_data. It can also show up as a non-responsive network interface, followed by a crash.
qemu-crash-macsonic-skb_release_data.log
To reproduce these symptoms requires heavy network traffic. Ping flooding can do it.
One way to reproduce the crash is with a few of these, after the network goes silent:
echo macsonic > /sys/bus/platform/drivers/macsonic/unbind
echo macsonic > /sys/bus/platform/drivers/macsonic/bind
echo macsonic > /sys/bus/platform/drivers/macsonic/unbind
echo macsonic > /sys/bus/platform/drivers/macsonic/bind
I found and fixed some bugs in the macsonic driver (see my github repo) but it didn't make a lot of difference.
Hello there're too many issue in the newer version above v2.0.0,when build with the static qemu-m68k q800-v2.4.0, it comes one error first:
/home/zwjj/Desktop/qemu-m68k-q800-v2.4.0/user-exec.c:112:5: error: too few arguments to function ‘cc->handle_mmu_fault’
ret = cc->handle_mmu_fault(cpu, address, is_write, MMU_USER_IDX);
we can see the file include/qom/cpu.h line 153: int (*handle_mmu_fault)(CPUState *cpu, vaddr address, int size, int rw, int mmu_index);
in the new version , the size argument is not use anymore,and I change the code,it comes more error : /home/zwjj/Desktop/qemu-m68k-q800-v2.4.0/linux-user/main.c: In function ‘cpu_loop’:
/home/zwjj/Desktop/qemu-m68k-q800-v2.4.0/linux-user/main.c:2997:14: error: ‘EXCP_UNSUPPORTED’ undeclared (first use in this function)
case EXCP_UNSUPPORTED:
^
/home/zwjj/Desktop/qemu-m68k-q800-v2.4.0/linux-user/main.c:2997:14: note: each undeclared identifier is reported only once for each function it appears in
this error can be solved by adding a new line #define EXCP_UNSUPPORTED 61 in target-m68k/cpu.h , and comes more error:
/home/zwjj/Desktop/qemu-m68k-q800-v2.4.0/linux-user/syscall.c: In function ‘host_to_target_data_link_rtattr’:
/home/zwjj/Desktop/qemu-m68k-q800-v2.4.0/linux-user/syscall.c:1563:10: error: ‘IFLA_CARRIER_CHANGES’ undeclared (first use in this function)
case IFLA_CARRIER_CHANGES:
^
/home/zwjj/Desktop/qemu-m68k-q800-v2.4.0/linux-user/syscall.c:1563:10: note: each undeclared identifier is reported only once for each function it appears in
/home/zwjj/Desktop/qemu-m68k-q800-v2.4.0/linux-user/syscall.c:1568:10: error: ‘IFLA_LINK_NETNSID’ undeclared (first use in this function)
case IFLA_LINK_NETNSID:
^
/home/zwjj/Desktop/qemu-m68k-q800-v2.4.0/linux-user/syscall.c: In function ‘host_to_target_data_addr_rtattr’:
/home/zwjj/Desktop/qemu-m68k-q800-v2.4.0/linux-user/syscall.c:1598:10: error: ‘IFA_FLAGS’ undeclared (first use in this function)
case IFA_FLAGS:
and it seems that the macro in the new version is QEMU_IFLA_NUM_RX_QUEUES with QEMU prefix,I'm not sure how to change that.
The branch q800-v1.1.0 seems no problem ,but when I use the qemu-system-m68k to lauch the kernel build in lxc ,it comes with segmentation fault when lauch /sbin/init and use other command.Can you tell me how to fix these issue
In try to run following code :
8004615a: 204f moveal %sp,%a0
8004615c: b1c7 cmpal %d7,%a0
8004615e: 55fc trapcs
80046160: 4e56 0000 linkw %fp,#0
80046164: 2f14 movel %a4@,%sp@-
80046166: 288e movel %fp,%a4@
80046168: c74d exg %a3,%a5
8004616a: 48e7 3030 moveml %d2-%d3/%a2-%a3,%sp@-
8004616e: 7001 moveq #1,%d0
80046170: 3b40 816c movew %d0,%a5@(-32404)
80046174: 7218 moveq #24,%d1
80046176: 3b41 816a movew %d1,%a5@(-32406)
8004617a: 242d 8004 movel %a5@(-32764),%d2
8004617e: 2b42 815c movel %d2,%a5@(-32420)
80046182: 206d 8008 moveal %a5@(-32760),%a0
80046186: 2268 8010 moveal %a0@(-32752),%a1
8004618a: 2b49 8158 movel %a1,%a5@(-32424)
8004618e: 42ad 8154 clrl %a5@(-32428)
80046192: 246d 8154 moveal %a5@(-32428),%a2
80046196: 2b4a 8160 movel %a2,%a5@(-32416)
8004619a: 2b4a 8164 movel %a2,%a5@(-32412)
8004619e: 422d 8168 clrb %a5@(-32408)
800461a2: 7604 moveq #4,%d3
800461a4: 2b43 8150 movel %d3,%a5@(-32432)
800461a8: 2668 8010 moveal %a0@(-32752),%a3
800461ac: 2b4b 814c movel %a3,%a5@(-32436)
800461b0: 2268 8010 moveal %a0@(-32752),%a1
800461b4: 266d 8008 moveal %a5@(-32760),%a3
800461b8: 206b 8008 moveal %a3@(-32760),%a0
800461bc: 4e90 jsr %a0@
800461be: 2b48 8148 movel %a0,%a5@(-32440)
800461c2: 4cdf 0c0c moveml %sp@+,%d2-%d3/%a2-%a3
800461c6: c74d exg %a3,%a5
800461c8: 289f movel %sp@+,%a4@
800461ca: 4e5e unlk %fp
800461cc: 4e75 rts
When I run qemu-m68k -cpu m68020 -d in_asm,cpu, I have :
----------------
IN:
0x8004615a: moveal %sp,%a0
0x8004615c: cmpal %d7,%a0
0x8004615e: trapcs
0x80046160: linkw %fp,#0
0x80046164: movel %a4@,%sp@-
0x80046166: movel %fp,%a4@
0x80046168: exg %a3,%a5
0x8004616a: moveml %d2-%d3/%a2-%a3,%sp@-
0x8004616e: moveq #1,%d0
0x80046170: movew %d0,%a5@(-32404)
0x80046174: moveq #24,%d1
0x80046176: movew %d1,%a5@(-32406)
0x8004617a: movel %a5@(-32764),%d2
0x8004617e: movel %d2,%a5@(-32420)
0x80046182: moveal %a5@(-32760),%a0
0x80046186: moveal %a0@(-32752),%a1
0x8004618a: movel %a1,%a5@(-32424)
0x8004618e: clrl %a5@(-32428)
0x80046192: moveal %a5@(-32428),%a2
0x80046196: movel %a2,%a5@(-32416)
0x8004619a: movel %a2,%a5@(-32412)
0x8004619e: clrb %a5@(-32408)
0x800461a2: moveq #4,%d3
0x800461a4: movel %d3,%a5@(-32432)
0x800461a8: moveal %a0@(-32752),%a3
0x800461ac: movel %a3,%a5@(-32436)
0x800461b0: moveal %a0@(-32752),%a1
0x800461b4: moveal %a5@(-32760),%a3
0x800461b8: moveal %a3@(-32760),%a0
0x800461bc: jsr %a0@
Trace 0: 0x7f83a807e780 [00000000/8004615a/00000000/00000000]
D0 = 00000012 A0 = 8004615a F0 = 7fff ffffffffffffffff ( nan)
D1 = 00000001 A1 = 800466d6 F1 = 7fff ffffffffffffffff ( nan)
D2 = 00000000 A2 = 00000000 F2 = 7fff ffffffffffffffff ( nan)
D3 = 00000000 A3 = 8000c3b0 F3 = 7fff ffffffffffffffff ( nan)
D4 = 00000000 A4 = 8004604c F4 = 7fff ffffffffffffffff ( nan)
D5 = 00000000 A5 = 3ffd7000 F5 = 7fff ffffffffffffffff ( nan)
D6 = 00000004 A6 = 80046038 F6 = 7fff ffffffffffffffff ( nan)
D7 = 80042050 A7 = 80045ff4 F7 = 7fff ffffffffffffffff ( nan)
PC SR = 0004 T:0 I:0 UI --Z--
FPSR = 00000000 ----
FPCR = 0000 X RN
----------------
IN:
0x80046358: lea %a1@(0,%d0:l),%a0
0x8004635c: rts
Trace 0: 0x7f83a807eac0 [00000000/80046358/00000000/00000000]
D0 = 00000001 A0 = 80046358 F0 = 7fff ffffffffffffffff ( nan)
D1 = 00000018 A1 = 00000000 F1 = 7fff ffffffffffffffff ( nan)
D2 = ffffffff A2 = 00000000 F2 = 7fff ffffffffffffffff ( nan)
D3 = 00000004 A3 = 8000c040 F3 = 7fff ffffffffffffffff ( nan)
D4 = 00000000 A4 = 8004604c F4 = 7fff ffffffffffffffff ( nan)
D5 = 00000000 A5 = 8000c3b0 F5 = 7fff ffffffffffffffff ( nan)
D6 = 00000004 A6 = 80046038 F6 = 7fff ffffffffffffffff ( nan)
D7 = 80042050 A7 = 80045fe0 F7 = 7fff ffffffffffffffff ( nan)
PC = 80046358 SR = 0004 T:0 I:0 UI --Z--
FPSR = 00000000 ----
FPCR = 0000 X RN
----------------
Stack pointer is 80045fe0, it should be 80045FD8.
When I run with options -cpu m68020 -d in_asm,cpu,op -singlestep, I have :
----------------
IN:
0x8004615e: trapcs
0x80046160: linkw %fp,#0
Disassembler disagrees with translator over instruction decoding
Please report this to [email protected]
OP:
ld_i32 tmp0,env,$0xfffffffffffffff8
brcond_i32 tmp0,$0x0,lt,$L0
---- 8004615e 00000000
mov_i32 tmp0,$0x0
call flush_flags,$0x0,$0,env,CC_OP
setcond_i32 tmp2,CC_C,tmp0,ne
neg_i32 tmp2,tmp2
mov_i32 tmp0,$0x56
mov_i32 PC,$0x80046162
exit_tb $0x0
set_label $L0
exit_tb $0x7fba001a75c3
D0 = 00000012 A0 = 80045ff4 F0 = 7fff ffffffffffffffff ( nan)
D1 = 00000001 A1 = 800466d6 F1 = 7fff ffffffffffffffff ( nan)
D2 = 00000000 A2 = 00000000 F2 = 7fff ffffffffffffffff ( nan)
D3 = 00000000 A3 = 8000c3b0 F3 = 7fff ffffffffffffffff ( nan)
D4 = 00000000 A4 = 8004604c F4 = 7fff ffffffffffffffff ( nan)
D5 = 00000000 A5 = 3ffd5000 F5 = 7fff ffffffffffffffff ( nan)
D6 = 00000004 A6 = 80046038 F6 = 7fff ffffffffffffffff ( nan)
D7 = 80042050 A7 = 80045ff4 F7 = 7fff ffffffffffffffff ( nan)
PC = 8004615e SR = 0000 T:0 I:0 UI -----
FPSR = 00000000 ----
FPCR = 0000 X RN
----------------
IN:
0x80046162: orib #20,%d0
OP:
ld_i32 tmp0,env,$0xfffffffffffffff8
brcond_i32 tmp0,$0x0,lt,$L0
---- 80046162 00000000
mov_i32 tmp0,$0x14
ext8s_i32 tmp3,D0
or_i32 tmp4,tmp3,tmp0
and_i32 D0,D0,$0xffffff00
ext8u_i32 tmp6,tmp4
or_i32 D0,D0,tmp6
ext8s_i32 CC_N,tmp4
discard CC_C
discard CC_Z
discard CC_V
mov_i32 CC_OP,$0xb
mov_i32 PC,$0x80046166
exit_tb $0x0
set_label $L0
exit_tb $0x7fba001a7683
D0 = 00000012 A0 = 80045ff4 F0 = 7fff ffffffffffffffff ( nan)
D1 = 00000001 A1 = 800466d6 F1 = 7fff ffffffffffffffff ( nan)
D2 = 00000000 A2 = 00000000 F2 = 7fff ffffffffffffffff ( nan)
D3 = 00000000 A3 = 8000c3b0 F3 = 7fff ffffffffffffffff ( nan)
D4 = 00000000 A4 = 8004604c F4 = 7fff ffffffffffffffff ( nan)
D5 = 00000000 A5 = 3ffd5000 F5 = 7fff ffffffffffffffff ( nan)
D6 = 00000004 A6 = 80046038 F6 = 7fff ffffffffffffffff ( nan)
D7 = 80042050 A7 = 80045ff4 F7 = 7fff ffffffffffffffff ( nan)
PC = 80046162 SR = 0000 T:0 I:0 UI -----
FPSR = 00000000 ----
FPCR = 0000 X RN
----------------
IN:
0x80046166: movel %fp,%a4@
OP:
ld_i32 tmp0,env,$0xfffffffffffffff8
brcond_i32 tmp0,$0x0,lt,$L0
...
I can see that instructions
0x80046160: linkw %fp,#0
0x80046164: movel %a4@,%sp@-
are not executed
and an extra instruction
0x80046162: orib #20,%d0
is executed
Trying to build piglit fails with:
cd "/<<PKGBUILDDIR>>/obj-m68k-linux-gnu/target_api/no_api/tests" && /usr/bin/cmake -E env "PIGLIT_BUILD_TREE=/<<PKGBUILDDIR>>/obj-m68k-linux-gnu" /usr/bin/python3.6 "/<<PKGBUILDDIR>>/tests/serializer.py" sanity "/<<PKGBUILDDIR>>/tests/sanity.py" "/<<PKGBUILDDIR>>/obj-m68k-linux-gnu/tests/sanity.xml.gz"
[ 0%] Generating builtin_cl_math_tests.list
cd "/<<PKGBUILDDIR>>/obj-m68k-linux-gnu/generated_tests" && /usr/bin/python3.6 "/<<PKGBUILDDIR>>/generated_tests/gen_cl_math_builtins.py" > builtin_cl_math_tests.list
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
Illegal instruction
make[3]: *** [generated_tests/CMakeFiles/gen-cl-tests.dir/build.make:76: generated_tests/builtin_cl_math_tests.list] Error 132
make[3]: *** Deleting file 'generated_tests/builtin_cl_math_tests.list'
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-m68k-linux-gnu'
make[2]: *** [CMakeFiles/Makefile2:101951: generated_tests/CMakeFiles/gen-cl-tests.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-m68k-linux-gnu'
[ 0%] Built target generate-sanity-xml
make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-m68k-linux-gnu'
make[1]: *** [Makefile:155: all] Error 2
make[1]: Leaving directory '/<<PKGBUILDDIR>>/obj-m68k-linux-gnu'
dh_auto_build: cd obj-m68k-linux-gnu && make -j2 "INSTALL=install --strip-program=true" returned exit code 2
make: *** [debian/rules:7: build-arch] Error 2
dpkg-buildpackage: error: debian/rules build-arch subprocess returned exit status 2```
Full log in:https://buildd.debian.org/status/fetch.php?pkg=piglit&arch=m68k&ver=0%7Egit20180515-62ef6b0db-1&stamp=1536489109&raw=0
Will provide a reproducer later.
cmake
3.11.x locks up qemu-m68k
and qemu-sh4
when trying to build a source code which uses cmake
. qemu-arm
is not affected by this issue.
The change with cmake
that caused this issue is the integration of libuv
for asynchronous I/O.
I will provide some strace
output later. I'm still in the process of gaining more data.
I was copy pasting about 1k of text into terminal to Linux operating over serial console (didn't setup ssh server and port mapping yet), and well, kernel said this:
[ 269.280000] ttyPZ0: pmz: rx irq flood !
after this, the terminal / serial console is not usable.
At least I can't sand anything again.
I guess it would make sense to throttle rx irqs on serial lines to be in some sane range? Try to emulate some baudrate limits that the driver expects to be sane too?
Linux 5.3.0
On i386, qemu-m68k segfaults when trying to enter the chroot:
root@jessie32:/srv/sid-m68k-sbuild> uname -a
Linux jessie32 4.8.0-0.bpo.2-686-pae #1 SMP Debian 4.8.11-1~bpo8+1 (2016-12-14) i686 GNU/Linux
root@jessie32:/srv/sid-m68k-sbuild> chroot .
qemu-m68k-static: /local_scratch/glaubitz/qemu-m68k/translate-all.c:179: tb_lock: Assertion `!have_tb_lock' failed.
qemu-m68k-static: /local_scratch/glaubitz/qemu-m68k/translate-all.c:179: tb_lock: Assertion `!have_tb_lock' failed.
Segmentation fault
root@jessie32:/srv/sid-m68k-sbuild>
The same git revision works fine on amd64:
root@jessie64:/srv/sid-m68k-sbuild> uname -a
Linux jessie64 4.7.0-0.bpo.1-amd64 #1 SMP Debian 4.7.8-1~bpo8+1 (2016-10-19) x86_64 GNU/Linux
root@jessie64:/srv/sid-m68k-sbuild> chroot .
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
(sid-m68k-sbuild)root@jessie64:/#
When tried to look at GHC to m68k (https://ghc.haskell.org/trac/ghc/ticket/11395)
I've got to a state where qemu-m68k fails to execute C-compiled code
with an internal error. Here is the selfcontained example that can crash qemu:
# m68k.S:
# build as:
# m68k-unknown-linux-gnu-gcc -nostdlib -nostartfiles m68k.S -o foo
# run as:
# qemu-m68k -d unimp,guest_errors,in_asm -L /usr/m68k-unknown-linux-gnu/ foo
#
# fails as:
# IN:
# 0x80000054: asll #2,%d0
# 0x80000056: movel %a0@-,%d2
# 0x80000058: rts
# qemu-m68k/tcg/tcg.c:1774: tcg fatal error
_start:
asll #2,%d0
movel %a0@-,%d2
rts
AFAIU this should not cause qemu fail to translate.
(for completeness) The real-world crash trace looks like that:
$ qemu-m68k-git -d unimp,guest_errors,in_asm -L /usr/m68k-unknown-linux-gnu/ /tmp/mul2
----------------
IN:
0xf550c812: moveq #32,%d5
0xf550c814: subl %d4,%d5
0xf550c816: movel %d6,%d0
0xf550c818: asll #2,%d0
0xf550c81a: addal %d0,%a0
0xf550c81c: addal %d0,%a1
0xf550c81e: movel %a0@-,%d2
0xf550c820: movel %d2,%d0
0xf550c822: lsrl %d5,%d0
0xf550c824: lsll %d4,%d2
0xf550c826: movel %d2,%d1
0xf550c828: subql #1,%d6
0xf550c82a: beqs 0xf550c856
qemu-m68k/tcg/tcg.c:1774: tcg fatal error
Trying to build erlang results in an illegal instruction encounter at some point:
megaco_ber_media_gateway_control_v1:
erlc -W -bber +noobj +legacy_erlang_types +asn1config megaco_ber_media_gateway_control_v1.set.asn
megaco_ber_media_gateway_control_v2:
erlc -W -bber +noobj +legacy_erlang_types +asn1config megaco_ber_media_gateway_control_v2.set.asn
megaco_ber_media_gateway_control_prev3a:
erlc -W -bber +noobj +legacy_erlang_types +asn1config megaco_ber_media_gateway_control_prev3a.set.asn
megaco_ber_media_gateway_control_prev3b:
erlc -W -bber +noobj +legacy_erlang_types +asn1config megaco_ber_media_gateway_control_prev3b.set.asn
megaco_ber_media_gateway_control_prev3c:
erlc -W -bber +noobj +legacy_erlang_types +asn1config megaco_ber_media_gateway_control_prev3c.set.asn
erlc -W +debug_info -Dmegaco_parser_inline -pa /<<BUILDDIR>>/erlang-19.3.1+dfsg/lib/et/ebin -pa /<<BUILDDIR>>/erlang-19.3.1+dfsg/lib/megaco/ebin +'{parse_transform,sys_pre_attributes}' +'{attribute,insert,app_vsn,"megaco-3.18.1"}' -I../../include -o../../ebin megaco_per_encoder.erl
megaco_ber_media_gateway_control_v3:
erlc -W -bber +noobj +legacy_erlang_types +asn1config megaco_ber_media_gateway_control_v3.set.asn
megaco_per_media_gateway_control_v1:
erlc -W -bper +noobj +legacy_erlang_types megaco_per_media_gateway_control_v1.set.asn
megaco_per_media_gateway_control_v2:
erlc -W -bper +noobj +legacy_erlang_types megaco_per_media_gateway_control_v2.set.asn
megaco_per_media_gateway_control_prev3a:
erlc -W -bper +noobj +legacy_erlang_types megaco_per_media_gateway_control_prev3a.set.asn
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
depend.mk:66: recipe for target 'megaco_per_media_gateway_control_v1.erl' failed
make[5]: *** [megaco_per_media_gateway_control_v1.erl] Illegal instruction
make[5]: *** Deleting file 'megaco_per_media_gateway_control_v1.erl'
make[5]: *** Waiting for unfinished jobs....
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
depend.mk:87: recipe for target 'megaco_per_media_gateway_control_v2.erl' failed
make[5]: *** [megaco_per_media_gateway_control_v2.erl] Illegal instruction
make[5]: *** Deleting file 'megaco_per_media_gateway_control_v2.erl'
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
depend.mk:109: recipe for target 'megaco_per_media_gateway_control_prev3a.erl' failed
make[5]: *** [megaco_per_media_gateway_control_prev3a.erl] Illegal instruction
make[5]: *** Deleting file 'megaco_per_media_gateway_control_prev3a.erl'
make[5]: Leaving directory '/<<BUILDDIR>>/erlang-19.3.1+dfsg/lib/megaco/src/binary'
/<<BUILDDIR>>/erlang-19.3.1+dfsg/make/otp_subdir.mk:29: recipe for target 'opt' failed
make[4]: *** [opt] Error 2
make[4]: Leaving directory '/<<BUILDDIR>>/erlang-19.3.1+dfsg/lib/megaco/src'
/<<BUILDDIR>>/erlang-19.3.1+dfsg/make/otp_subdir.mk:29: recipe for target 'opt' failed
make[3]: *** [opt] Error 2
make[3]: Leaving directory '/<<BUILDDIR>>/erlang-19.3.1+dfsg/lib/megaco'
The issue is 100% reproducible in a manual build:
root@pacman:/builg/lib/megaco/src/binary# /lib/megaco/src/binary# erlc -W -bper +noobj +legacy_erlang_types megaco_per_mtrol_prev3a.set.asnbper +noobj +legacy_erlang_types megaco_per_m
Illegal instruction (core dumped)
root@pacman:/build/erlang/erlang-20.0+dfsg/lib/megaco/src/binary#
Tarball with build root can be found here: https://people.debian.org/~glaubitz/erlang.tgz
To reproduce:
# apt build-dep --arch-only erlang
# mkdir /build
# mv erlang.tgz /build
# cd /build
# tar xf erlang.tgz
# export PATH=$PATH:/build/erlang/erlang-20.0+dfsg/bin/m68k-unknown-linux-gnu:/build/erlang/erlang-20.0+dfsg/bootstrap/bin
# cd erlang-20.0+dfsg/lib/megaco/src/binary/
# erlc -W -bper +noobj +legacy_erlang_types megaco_per_media_gateway_control_prev3a.set.asn
Illegal instruction (core dumped)
#
This is another issue which will be hard to track down. The fix from 843cd25 already brought lots of improvement, so that many Haskell packages build now fine. But there are still some occasional hickups [1]:
[ 6 of 27] Compiling UU.Pretty ( src/UU/Pretty.hs, dist-ghc/build/UU/Pretty.o )
[ 7 of 27] Compiling UU.PPrint ( src/UU/PPrint.hs, dist-ghc/build/UU/PPrint.o )
src/UU/PPrint.hs:371:25: error: parse error on input `Union'
/usr/share/cdbs/1/class/hlibrary.mk:147: recipe for target 'build-ghc-stamp' failed
make: *** [build-ghc-stamp] Error 1
dpkg-buildpackage: error: debian/rules build-arch gave error exit status 2
The problem with this one is that it's not easily reproducible but it does occur. As already mentioned in #20, maybe we need to add the fix from e9f4459 for the other CAS instructions as well?
[1] https://buildd.debian.org/status/fetch.php?pkg=haskell-uulib&arch=m68k&ver=0.9.20-4&stamp=1482707292
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.