Bug#1004255: linux-image-5.14.0-1-sparc64-smp: Debian kernels > 5.14.3-1~exp1 fail to boot on SPARC T4-1 with Fast Data Access MMU Miss

2022-01-31 Thread Tom Turelinckx
Hi Adrian,

> This looks more like an issue with your bootloader. I haven't used SILO for a
> long time, so I don't have a track what currently works and what not.

Thanks for pointing that out! I was searching in the wrong direction...

> Can you try booting the current ISO snapshot image?

Yes, that image boots successfully on this machine, with a newer kernel, using 
GRUB instead of SILO.

So the actual issue is that Debian kernels > 5.14.3-1~exp1 fail to boot with 
SILO 1.4.14+git20141019-5.
I've also built the latest SILO from git [1] but it has the same issue: it 
boots Debian kernel 5.14.3-1~exp1
successfully, but later Debian kernels fail with ERROR: Last Trap: Fast Data 
Access MMU Miss.

I had previously given up on migrating to GRUB, as I couldn't get it to work 
with RAID1 boot and root
partitions on disks with a Sun disk label. I still can't get that working but 
I'll start a separate thread
for that.

As this SPARC T4-1 is able to boot from disks with GPT/EFI disk label, I've 
converted the disks to use
a GPT/EFI label with a dedicated BIOS boot partition and installed GRUB using 
the instructions at [2].
It is working fine with RAID1 boot and root partitions and with newer Debian 
kernels.

It would still be nice to know why newer Debian kernels fail to boot with SILO, 
but I don't know how
to debug ERROR: Last Trap: Fast Data Access MMU Miss.

This Debian bug report can be closed as resolved by migrating from SILO to GRUB.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/davem/silo.git
[2] https://github.com/esnowberg/grub2-sparc/wiki



Bug#1004255: linux-image-5.14.0-1-sparc64-smp: Debian kernels > 5.14.3-1~exp1 fail to boot on SPARC T4-1 with Fast Data Access MMU Miss

2022-01-23 Thread Tom Turelinckx
Package: src:linux
Version: 5.14.6-2
Severity: important
X-Debbugs-Cc: debian-sp...@lists.debian.org

Dear Maintainer,

Debian kernels > 5.14.3-1~exp1 consistently fail to boot on SPARC T4-1:

SPARC T4-1, No Keyboard
Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
OpenBoot 4.36.2, 31.5000 GB memory available, Serial #108045182.
Ethernet address 0:10:e0:70:a3:7e, Host ID: 8670a37e.



Boot device: disk0  File and args: 
SILO Version 1.4.14
boot: 
Allocated 64 Megs of memory at 0x4000 for kernel
Uncompressing image...
Loaded kernel version 5.14.6
Loading initial ramdisk (25723814 bytes at 0x2480 phys, 0x40C0 virt)...
ERROR: Last Trap: Fast Data Access MMU Miss

Debian kernels 5.14.3-1~exp1 and earlier boot and run successfully on this 
system.

I have tried the sparc64-smp packages built by buildd landau for these versions:
5.14.6-2, 5.14.6-3, 5.14.9-2, 5.15.5-2, 5.15.15-1, 5.16~rc8-1~exp1
They all consistently fail to boot with the same error.

I have built the Debian src pkg version 5.14.6-1 using pbuilder with a sid 
basetgz.
It consistently fails to boot with the same error.

I've then tried to bisect using the DebianKernel/GitBisect instructions on the 
Debian wiki,
but it turns out that kernels built from git (tag v5.14.3, tag v5.14.6, and ~9 
bisects in between)
using make bindeb-pkg all do boot successfully on this system.

I've tried checking out tag v5.14.6 from git, then applying all the patches 
from debian/patches
in the 5.14.6-1 src pkg and building using make bindeb-pkg. The resulting 
kernel boots successfully.

I've tried extracting the 5.14.6-1 src pkg using dpkg-source -x, then building 
using make bindeb-pkg
and the resulting kernel boots succesfully. But if I build using 
dpkg-buildpackage like pbuilder does,
then the resulting -sparc64-smp package fails to boot with the above error.

When building, I have used each time a clean sid changeroot. When using make 
bindeb-pkg I have copied
the config installed in /boot by the (non-booting) 5.14.6-1 Debian package then 
done make olddefconfig.
When using make bindeb-pkg I had to manually disable stringop-overread warnings 
in Makefile to avoid
build failure on arch/sparc/kernel/mdesc.c with v5.14.6 (fixed in later 
versions by [1]). 

When building using bindeb-pkg the resulting kernel is compressed; when using 
dpkg-buildpackage the
resulting kernel is uncompressed. I have tried both uncompressing the 
compressed kernel and compressing
the uncompressed kernel, as silo supports both. It doesn't affect the results. 
Uncompressed, the Debian
kernel is ~17MB while the standard kernel is ~13MB. I'm not sure why this 
difference is there.

On Debian salsa's kernel-team/linux I have combed through all the commits 
between tags debian/5.14.3-1_exp1
and debian/5.14.6-1, but none of them seem relevant to this issue. I have 
checked the upstream changelog
between v5.14.3 and v5.14.6, but nothing sparc-specific has changed. 

According to the buildd logs, landau is running kernel 5.15.5-2. But I think 
this is a SPARC-T5 so not
a T4, and I think it's running inside an LDOM which is not the case on my T4, 
so it may not be comparable.

I've also tried to get more information about the failure, but I don't know how 
to do that. I've tried
to get into the initramfs environment by using break=premount/modules/top, but 
the failure happens before
those stages. Measuring the elapsed time after Loading initial ramdisk it would 
seem the error message
ERROR: Last Trap: Fast Data Access MMU Miss appears when normally the first 
kernel output would appear.

I've tried to look into what the Debian src pkg's debian/* scripts do, exactly, 
but this is rather
complicated and I have limited experience with it.

Any suggestions what else I could try?

[1]: 
https://github.com/gregkh/linux/commit/fc7c028dcdbfe981bca75d2a7b95f363eb691ef3

-- Package-specific info:
** Kernel log: boot messages should be attached

** Model information
cpu : UltraSparc T4 (Niagara4)
fpu : UltraSparc T4 integrated FPU
pmu : niagara4
prom: OBP 4.36.2 2014/10/24 08:13
type: sun4v

** Network interface configuration:
*** /etc/network/interfaces:

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto br0
iface br0 inet static
bridge_ports enp15s0f0
bridge_fd 0
address x.x.x.x
netmask x.x.x.x
gateway x.x.x.x
iface enp15s0f0 inet manual


** PCI devices:
00:01.0 PCI bridge [0604]: Oracle/SUN Device [108e:8186] (rev 01) (prog-if 00 
[Normal decode])
Device tree node: /sys/firmware/devicetree/base/pci@400/pci@1
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- TAbort- Reset- FastB2B-
PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
Capabilities: 

00:02.0 PCI bridge [0604]: Oracle/SUN Device 

Bug#887592: linux: 4.9.65-3 FTBFS on sparc64: arch/sparc/lib/multi3.S missing patch

2018-01-18 Thread Tom Turelinckx
Source: linux
Version: 4.9.65-3
Severity: serious
Tags: patch
Justification: fails to build from source (but built successfully in the past)

linux 4.9.65-3 (Stretch 9.3), as well as 4.9.51-1 and 4.9.47-1 FTBFS on sparc64:

/build/linux-4.9.65/arch/sparc/lib/multi3.S:2:24: fatal error: asm/export.h: No 
such file or directory
 #include 
^
compilation terminated.
/build/linux-4.9.65/scripts/Makefile.build:398: recipe for target 
'arch/sparc/lib/multi3.o' failed

It seems commit 1b4af13ff2cc "sparc64: Add __multi3 for gcc 7.x and later." was 
backported to 4.9 in 4.9.32 (commit 4b684e6474d0), but 
/debian/patches/bugfix/sparc/revert-sparc-move-exports-to-definitions.patch 
doesn't patch /arch/sparc/lib/multi3.S.

Applying the following patch, taken from linux 4.11.11-1's 
revert-sparc-move-exports-to-definitions.patch allows the build to succeed on 
sparc64 for linux 4.9.65-3, as well as 4.9.51-1 and 4.9.47-1:

--- a/arch/sparc/lib/multi3.S
+++ b/arch/sparc/lib/multi3.S
@@ -1,5 +1,4 @@
 #include 
-#include 
 
.text
.align  4
@@ -32,4 +31,3 @@ ENTRY(__multi3) /* %o0 = u, %o1 = v */
retl
 add%g1, %o0, %o0
 ENDPROC(__multi3)
-EXPORT_SYMBOL(__multi3)

Would it be possible to include this patch in future linux 4.9.x packages? 
Thanks!

Best regards,
Tom Turelinckx

-- System Information:
Debian Release: 9.0
Architecture: sparc64

Kernel: Linux 4.9.0-3-sparc64-smp (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)