Re: GRUB testers on SPARC needed

2017-12-17 Thread txt.file
I tested it on a SunFire V440 and it is booting. I plan to test it also
on a Sun Netra T1.

root@txt-sunfire-v440:~# lsblk
NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda 8:00 67.9G  0 disk
├─sda1  8:10 94.1M  0 part /boot
├─sda2  8:20 67.8G  0 part
│ ├─txt--sunfire--v440--vg-root   254:00 11.7G  0 lvm  /
│ ├─txt--sunfire--v440--vg-swap_1 254:10  7.7G  0 lvm  [SWAP]
│ ├─txt--sunfire--v440--vg-var254:20  4.2G  0 lvm  /var
│ ├─txt--sunfire--v440--vg-tmp254:30  800M  0 lvm  /tmp
│ └─txt--sunfire--v440--vg-home   254:40 43.5G  0 lvm  /home
└─sda3  8:30 67.9G  0 part
sr011:01 1024M  0 rom
root@txt-sunfire-v440:~#

kind regards
txt.file

John Paul Adrian Glaubitz:
> Hi!
> 
> We're in the process of migrating Debian for sparc64 from SILO to GRUB
> as GRUB upstream is adding support for modern SPARC machines thanks to
> the work of Eric Snowberg from Oracle.
> 
> In order to make sure GRUB works on all machines supported by the sparc64
> port, we need your help to test GRUB on your particular hardware, the older
> your machine, the better.
> 
> So, in order to help us, please follow the guide below to install GRUB to
> replace SILO as your boot loader.
> 
> NOTE: If your system doesn't boot after installing GRUB, don't panic. Use
>   the current Debian sparc64 installation image and boot into rescue
>   mode by typing "rescue". Then chroot into your installed system and
>   just run "silo -t -f" to restore SILO on your machine.
> 
> 1. Install the grub2 package:
> 
> root@andi:~# apt install grub2
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> The following additional packages will be installed:
>   grub-common grub-ieee1275 grub-ieee1275-bin grub2-common libfreetype6 
> libfuse2 libpng16-16 os-prober
> Suggested packages:
>   multiboot-doc xorriso desktop-base console-setup fuse
> The following NEW packages will be installed:
>   grub-common grub-ieee1275 grub-ieee1275-bin grub2 grub2-common libfreetype6 
> libfuse2 libpng16-16 os-prober
> 0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
> Need to get 4,556 kB of archives.
> After this operation, 23.6 MB of additional disk space will be used.
> Do you want to continue? [Y/n] y
> Get:1 http://ftp.ports.debian.org/debian-ports unstable/main sparc64 
> libpng16-16 sparc64 1.6.34-1 [271 kB]
> (...)
> 
> Creating config file /etc/default/grub with new version
> Setting up grub2 (2.02-2+sparc64.3) ...
> root@andi:~#
> 
> 2. Make sure you have version 2.02-2+sparc64.3
> 
> root@andi:~# apt-cache show grub2 |grep Version
> Version: 2.02-2+sparc64.3
> root@andi:~#
> 
> 3. Find your boot partition:
> 
> root@andi:~# mount |grep /boot
> /dev/sda1 on /boot type ext3 (rw,relatime,data=ordered)
> root@andi:~#
> 
> If you don't have one but just one root file system, grep for " / " instead
> 
> 4. Install grub into your boot partition:
> 
> root@andi:~# grub-install --force --skip-fs-probe /dev/sda1
> Installing for sparc64-ieee1275 platform.
> grub-install: warning: Discarding improperly nested partition 
> (hostdisk//dev/sda,sun1,sun2).
> grub-install: warning: Discarding improperly nested partition 
> (hostdisk//dev/sda,sun1,sun4).
> grub-install: warning: Attempting to install GRUB to a disk with multiple 
> partition labels.  This is not supported yet..
> grub-install: warning: Embedding is not possible.  GRUB can only be installed 
> in this setup by using blocklists.  However, blocklists are UNRELIABLE and 
> their use is discouraged..
> Installation finished. No error reported.
> root@andi:~#
> 
> Note: If you are using GPT partition tables instead of Sun partition
>   tables, you need to install GRUB into /dev/sda
>   (see: https://github.com/esnowberg/grub2-sparc/wiki)
> 
> 5. Run update-grub:
> 
> root@andi:~# update-grub
> Generating grub configuration file ...
> Found linux image: /boot/vmlinuz-4.14.0-1-sparc64-smp
> Found initrd image: /boot/initrd.img-4.14.0-1-sparc64-smp
> Found linux image: /boot/vmlinuz-4.14.0-trunk-sparc64-smp
> Found initrd image: /boot/initrd.img-4.14.0-trunk-sparc64-smp
> Found linux image: /boot/vmlinuz-4.14.0-rc7-sparc64-smp
> Found initrd image: /boot/initrd.img-4.14.0-rc7-sparc64-smp
> Found linux image: /boot/vmlinuz-4.14.0-rc5-sparc64-smp
> Found initrd image: /boot/initrd.img-4.14.0-rc5-sparc64-smp
> Found linux image: /boot/vmlinuz-4.12.0-rc1-sparc64-smp
> Found initrd image: /boot/initrd.img-4.12.0-rc1-sparc64-smp
> Found linux image: /boot/vmlinuz-4.11.0-trunk-sparc64-smp
> Found initrd image: /boot/initrd.img-4.11.0-trunk-sparc64-smp
> Found linux image: /boot/vmlinuz-4.10.0-trunk-sparc64-smp
> Found initrd image: /boot/initrd.img-4.10.0-trunk-sparc64-smp
> Found Debian GNU/Linux buster/sid on /dev/md0p1
> done
> root@andi:~#
> 

Bug#884642: libgo11: Please backport upstream sparc64 fix

2017-12-17 Thread James Clarke
Package: libgo11
Version: 7.2.0-17
Tags: upstream fixed-upstream patch
User: debian-sparc@lists.debian.org
Usertags: sparc64
X-Debbugs-Cc: debian-sparc@lists.debian.org

Hi,
For a while, libgo11 on sparc64 has been broken, with executables
crashing with messages like:

> runtime: lfstackpush invalid packing: node=0xfff8000102424000 cnt=1 
> packed=283958541549569 -> node=0x102424000

whenever runtime_gc is called. This is because lfstack_64bit.go has
incorrect assumptions about the virtual address space, and so clobbers
the node address when packing. Please apply the attached debdiff, which
is a backport of the upstream fix (the change to gcc/go/gofrontend/MERGE
has been dropped as it's needless noise that is likely to just cause
conflicts). In my testing it completely fixes that error with no traces
of it in the build log.

Regards,
James
diff -u gcc-7-7.2.0/debian/rules.patch gcc-7-7.2.0/debian/rules.patch
--- gcc-7-7.2.0/debian/rules.patch
+++ gcc-7-7.2.0/debian/rules.patch
@@ -75,6 +75,7 @@
pr77631 \
pr67165 \
cuda-float128 \
+   libgo-sparc64 \
libgo-ia64 \
pr82880 \
libcc1-compiler-name \
only in patch2:
unchanged:
--- gcc-7-7.2.0.orig/debian/patches/libgo-sparc64.diff
+++ gcc-7-7.2.0/debian/patches/libgo-sparc64.diff
@@ -0,0 +1,99 @@
+From c536feb42f56afd6397697f9ee9e5d8d918bef1b Mon Sep 17 00:00:00 2001
+From: ian 
+Date: Wed, 31 May 2017 21:36:42 +
+Subject: [PATCH] libgo: support for sparc64 GNU/Linux
+
+Fix lfstack code to work with sparc64 GNU/Linux address map.
+
+Force alignment of epollevent.  To make this work reliably, pass
+GOARCH explicitly to mkrsysinfo.sh.
+
+Patch by Vladimir Mezentsev.
+
+Reviewed-on: https://go-review.googlesource.com/44494
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248765 
138bc75d-0d04-0410-961f-82ee72b054a4
+---
+[gcc/go/gofrontend/MERGE   |  2 +-]
+ libgo/Makefile.am |  2 +-
+ libgo/Makefile.in |  2 +-
+ libgo/go/runtime/lfstack_64bit.go | 12 
+ libgo/mkrsysinfo.sh   |  6 +-
+ 5 files changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/src/libgo/Makefile.am b/src/libgo/Makefile.am
+index 8bbd43771447..0f9881ffaa4e 100644
+--- a/src/libgo/Makefile.am
 b/src/libgo/Makefile.am
+@@ -531,7 +531,7 @@ s-version: Makefile
+ 
+ runtime_sysinfo.go: s-runtime_sysinfo; @true
+ s-runtime_sysinfo: $(srcdir)/mkrsysinfo.sh gen-sysinfo.go
+-  $(SHELL) $(srcdir)/mkrsysinfo.sh
++  GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mkrsysinfo.sh
+   $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime_sysinfo.go runtime_sysinfo.go
+   $(STAMP) $@
+ 
+diff --git a/src/libgo/Makefile.in b/src/libgo/Makefile.in
+index cbdd37998369..2452f967252b 100644
+--- a/src/libgo/Makefile.in
 b/src/libgo/Makefile.in
+@@ -3081,7 +3081,7 @@ s-version: Makefile
+ 
+ runtime_sysinfo.go: s-runtime_sysinfo; @true
+ s-runtime_sysinfo: $(srcdir)/mkrsysinfo.sh gen-sysinfo.go
+-  $(SHELL) $(srcdir)/mkrsysinfo.sh
++  GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mkrsysinfo.sh
+   $(SHELL) $(srcdir)/mvifdiff.sh tmp-runtime_sysinfo.go runtime_sysinfo.go
+   $(STAMP) $@
+ 
+diff --git a/src/libgo/go/runtime/lfstack_64bit.go 
b/src/libgo/go/runtime/lfstack_64bit.go
+index 213efb107068..b314a3ba2169 100644
+--- a/src/libgo/go/runtime/lfstack_64bit.go
 b/src/libgo/go/runtime/lfstack_64bit.go
+@@ -32,9 +32,18 @@ const (
+   // bottom, because node must be pointer-aligned, giving a total of 19 
bits
+   // of count.
+   cntBits = 64 - addrBits + 3
++
++  // On sparc64-linux, user addresses are 52-bit numbers sign extended to 
64.
++  // We shift the address left 12 to eliminate the sign extended part and 
make
++  // room in the bottom for the count.
++  sparcLinuxAddrBits = 52
++  sparcLinuxCntBits  = 64 - sparcLinuxAddrBits + 3
+ )
+ 
+ func lfstackPack(node *lfnode, cnt uintptr) uint64 {
++  if GOARCH == "sparc64" && GOOS == "linux" {
++  return 
uint64(uintptr(unsafe.Pointer(node)))<<(64-sparcLinuxAddrBits) | 
uint64(cnt&(1<> cntBits 
<< 3)))
+   }
++  if GOARCH == "sparc64" && GOOS == "linux" {
++  return (*lfnode)(unsafe.Pointer(uintptr(int64(val) >> 
sparcLinuxCntBits << 3)))
++  }
+   return (*lfnode)(unsafe.Pointer(uintptr(val >> cntBits << 3)))
+ }
+diff --git a/src/libgo/mkrsysinfo.sh b/src/libgo/mkrsysinfo.sh
+index a86e9143bf46..6ab80e625d93 100755
+--- a/src/libgo/mkrsysinfo.sh
 b/src/libgo/mkrsysinfo.sh
+@@ -83,7 +83,11 @@ if grep '^const _epoll_data_offset ' ${OUT} >/dev/null 
2>&1;