Hi,
Perhaps I'm missing here something, but seems I can only run 32bit arm programs on arm64 system if I am root. So far even the simplest hello world will be killed/segfaulted on startup. This is on mustang hw.
taking on 3.19-rc3 with arch=arm64 and make defconfig:
wget http://kos.to/hello-test/hello # file hello hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=c37a3b366d645eee600963a535370fa0bad9b2c0, not stripped # ./hello hello world # su - linaro $ /root/hello Segmentation fault $ gdb /root/hello (gdb) run Starting program: /root/hello During startup program terminated with signal SIGSEGV, Segmentation fault.
If you have a debian/ubuntu system, you can also reproduce it with multiarch:
dpkg --add-architecture armhf apt-get update apt-get install hello:armhf # hello Hello, world! # su - ubuntu $ hello Segmentation fault $
On Wed, Jan 28, 2015 at 10:52:21AM +0000, Riku Voipio wrote:
Perhaps I'm missing here something, but seems I can only run 32bit arm programs on arm64 system if I am root. So far even the simplest hello world will be killed/segfaulted on startup. This is on mustang hw.
taking on 3.19-rc3 with arch=arm64 and make defconfig:
It works for me with the arm64 for-next/core branch, I haven't tried vanilla 3.19-rc3 yet. Do you have other patches applied?
wget http://kos.to/hello-test/hello # file hello hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=c37a3b366d645eee600963a535370fa0bad9b2c0, not stripped # ./hello hello world # su - linaro $ /root/hello Segmentation fault $ gdb /root/hello (gdb) run Starting program: /root/hello During startup program terminated with signal SIGSEGV, Segmentation fault.
Do you get some kernel message?
This works for me with Debian armel.
If you have a debian/ubuntu system, you can also reproduce it with multiarch:
dpkg --add-architecture armhf apt-get update apt-get install hello:armhf # hello Hello, world! # su - ubuntu $ hello Segmentation fault $
This works as well.
What does this say:
# cat /proc/sys/vm/mmap_min_addr
If it is 64K, it won't run 32-bit apps as non-root.
On 28/01/15 11:22, Catalin Marinas wrote:
On Wed, Jan 28, 2015 at 10:52:21AM +0000, Riku Voipio wrote:
Perhaps I'm missing here something, but seems I can only run 32bit arm programs on arm64 system if I am root. So far even the simplest hello world will be killed/segfaulted on startup. This is on mustang hw.
taking on 3.19-rc3 with arch=arm64 and make defconfig:
It works for me with the arm64 for-next/core branch, I haven't tried vanilla 3.19-rc3 yet. Do you have other patches applied?
I'm running -rc5 on mustang, and this works perfectly fine:
maz@mystery-roach:~$ uname -a Linux mystery-roach 3.19.0-rc5+ #3704 SMP Wed Jan 28 11:25:36 GMT 2015 aarch64 GNU/Linux maz@mystery-roach:~$ file hello hello: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, for GNU/Linux 2.6.32, BuildID[sha1]=c37a3b366d645eee600963a535370fa0bad9b2c0, not stripped maz@mystery-roach:~$ id uid=1000(maz) gid=1000(maz) groups=1000(maz),27(sudo),110(kvm) maz@mystery-roach:~$ ./hello hello world
Userspace is Debian arm64 unstable.
M.
On 28 January 2015 at 13:22, Catalin Marinas catalin.marinas@arm.com wrote:
On Wed, Jan 28, 2015 at 10:52:21AM +0000, Riku Voipio wrote: What does this say:
cat /proc/sys/vm/mmap_min_addr 65536
# cat /proc/sys/vm/mmap_min_addr
If it is 64K, it won't run 32-bit apps as non-root.
echo 32768 > /proc/sys/vm/mmap_min_addr
and indeed binaries work as expected.
The ubuntu LTS 3.13 kernel has:
/boot/config-3.13.0-39-generic:CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
I need to check how the value ended up wrong on the 3.19-rc3 I tested.
-- Catalin
On Wed, Jan 28, 2015 at 11:42:55AM +0000, Riku Voipio wrote:
On 28 January 2015 at 13:22, Catalin Marinas catalin.marinas@arm.com wrote:
On Wed, Jan 28, 2015 at 10:52:21AM +0000, Riku Voipio wrote: What does this say:
cat /proc/sys/vm/mmap_min_addr 65536
# cat /proc/sys/vm/mmap_min_addr
If it is 64K, it won't run 32-bit apps as non-root.
echo 32768 > /proc/sys/vm/mmap_min_addr
and indeed binaries work as expected.
The ubuntu LTS 3.13 kernel has:
/boot/config-3.13.0-39-generic:CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
I need to check how the value ended up wrong on the 3.19-rc3 I tested.
It may be set by some boot script on arm64 Ubuntu (so entirely in user space).
On 28 January 2015 at 13:47, Catalin Marinas catalin.marinas@arm.com wrote:
On Wed, Jan 28, 2015 at 11:42:55AM +0000, Riku Voipio wrote:
On 28 January 2015 at 13:22, Catalin Marinas catalin.marinas@arm.com wrote:
On Wed, Jan 28, 2015 at 10:52:21AM +0000, Riku Voipio wrote: What does this say:
cat /proc/sys/vm/mmap_min_addr 65536
# cat /proc/sys/vm/mmap_min_addr
If it is 64K, it won't run 32-bit apps as non-root.
echo 32768 > /proc/sys/vm/mmap_min_addr
and indeed binaries work as expected.
The ubuntu LTS 3.13 kernel has:
/boot/config-3.13.0-39-generic:CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
I need to check how the value ended up wrong on the 3.19-rc3 I tested.
It may be set by some boot script on arm64 Ubuntu (so entirely in user space).
Correct, the invalid value is set in /etc/sysctl.d/10-zeropage.conf. I've also opened a bug for the ubuntu folk to fix.
https://bugs.launchpad.net/ubuntu/+source/procps/+bug/1415481
Riku
linaro-kernel@lists.linaro.org