TLS register TPIDRURW not preserved on context switch and fork

Bug #1265024 reported by Martin Storsjö
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-ti-omap4 (Ubuntu)
Incomplete
Medium
Joseph Salisbury

Bug Description

Please backport commit a4780adeefd042482f624f5e0d577bf9cdcbb760 (which is included in upstream kernel 3.11) to the ti-omap4 packages for ubuntu precise.

I tried doing this manually, and when cherrypicking there's a minor pretty trivial conflict to resolve, and after cherrypicking it works just fine.
---
ApportVersion: 2.0.1-0ubuntu17.6
Architecture: armhf
DistroRelease: Ubuntu 12.04
MarkForUpload: True
Package: linux-image-omap4 3.2.0.1441.39
PackageArchitecture: armhf
ProcVersionSignature: Ubuntu 3.2.0-1442.61-omap4 3.2.53
Tags: precise
Uname: Linux 3.2.0-1442-omap4 armv7l
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo

Changed in linux-ti-omap4 (Ubuntu):
importance: Undecided → Medium
tags: added: precise
Changed in linux-ti-omap4 (Ubuntu):
status: New → Triaged
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

I built a Precise test kernel with a cherry-pick and backport of commit a4780ad.

The test kernel can be downloaded from:
http://kernel.ubuntu.com/~jsalisbury/lp1265024

Can you test that kernel and report back if it has the bug or not.

Thanks in advance

Changed in linux-ti-omap4 (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Joseph Salisbury (jsalisbury)
Revision history for this message
Martin Storsjö (ub71a5bwc-6kfi2n-b69y0hv8h) wrote :

Can you provide an armhf .deb? I guess it doesn't really matter much from the kernel point of view, but my dpkg doesn't want to install them.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

I built an armhf test kernel.

The test kernel can be downloaded from:
http://kernel.ubuntu.com/~jsalisbury/lp1265024/armhf

Can you test that kernel and report back if it has the bug or not?

Revision history for this message
Martin Storsjö (ub71a5bwc-6kfi2n-b69y0hv8h) wrote :

This test kernel doesn't boot at all (I had to modify flash-kernel for it to be installed at all - flash-kernel points out that my subarchitecture is omap4 while this kernel is plain omap).

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Thanks for the update. I'll investigate why this kernel build failed for you.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

I built the kernel again using a Trusty schroot. Can you give the following kernel a try:

http://kernel.ubuntu.com/~jsalisbury/lp1265024/armhf

Revision history for this message
Martin Storsjö (ub71a5bwc-6kfi2n-b69y0hv8h) wrote :

This kernel doesn't boot for me either, although I'm not really sure what is going wrong.

I've installed it by downloading linux-headers-3.2.0-58-omap, linux-headers-3.2.0-58 and linux-image-3.2.0-58-omap, doing dpkg -i on those three .debs, and later run a modified version of the flash-kernel script to install it (to allow this to be flashed despite the omap vs omap4 mismatch).

On boot it goes as far as "Starting kernel ..." but it never prints "Uncompressing Linux" as the other kernels do.

The test kernel I built myself that works just fine was built using the cross building instructions from http://omappedia.org/wiki/Ubuntu_kernel_for_OMAP4, based on http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-precise.git;a=shortlog;h=refs/heads/ti-omap4, with the cherry-picked conflict resolved as in the attached patch.

tags: added: patch
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

I think I was using the wrong branch. I'll rebuild a new kernel with the patch and post it shortly.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

I built an armhf test kernel.

The test kernel can be downloaded from:
http://kernel.ubuntu.com/~jsalisbury/lp1265024

Can you test that kernel and report back if it has the bug or not?

Revision history for this message
Martin Storsjö (ub71a5bwc-6kfi2n-b69y0hv8h) wrote :

Ok, so now there's some progress but it still doesn't work right. Now the kernel uncompresses ok but something still goes wrong when it should be booted - it goes as far as "Uncompressing Linux... done, booting the kernel." but nothing past that.

For the record, I wasn't able to install the linux-header packages since they depended on a newer glibc than what's available in 12.04, but I installed the linux-header packages that I built myself (which happen to have the same version number as yours) together with your linux-image .deb.

Revision history for this message
Martin Storsjö (ub71a5bwc-6kfi2n-b69y0hv8h) wrote :

I forgot to mention - I've removed the "quiet splash" options from /boot/boot.script, so I normally get everything starting from this:
[ 0.000000] Booting Linux on physical CPU 0

But with your kernel I don't get this far.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

I'd like to see if building a stock kernel, without the patch, will boot on your device. I built a new kernel using a saucy schroot, which can be downloaded from:

http://kernel.ubuntu.com/~jsalisbury/lp1265024

Can you see if this kernel boots?

Revision history for this message
Martin Storsjö (ub71a5bwc-6kfi2n-b69y0hv8h) wrote :

I really doubt this patch is what breaks it, but I'll test your kernel tomorrow. I'm not sure whether a saucy chroot would work or not - I first tried cross-building from 13.04 but ran into some issues there, so I cross-built from a 12.04 chroot instead. But my issues were in the build scripts and the kernel itself of course shouldn't rely on anything from the surrounding distro. Anyway, I'll try it tomorrow.

Revision history for this message
Martin Storsjö (ub71a5bwc-6kfi2n-b69y0hv8h) wrote :

This kernel doesn't boot either, it stops after "done, booting the kernel." just as the previous one.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Can you collect the apport data on this device:

apport-collect 1265024

Revision history for this message
Martin Storsjö (ub71a5bwc-6kfi2n-b69y0hv8h) wrote : Dependencies.txt

apport information

tags: added: apport-collected
description: updated
Revision history for this message
Martin Storsjö (ub71a5bwc-6kfi2n-b69y0hv8h) wrote : ProcEnviron.txt

apport information

Revision history for this message
Martin Storsjö (ub71a5bwc-6kfi2n-b69y0hv8h) wrote :

Running only "apport-collect 1265024" gave:

---
Package linux-ti-omap4 not installed and no hook available, ignoring

*** Updating problem report

No additional information collected.
---

So then I ran "apport-collect -p linux-image-omap4 1265024" instead, which seems to have uploaded something at least although I'm not sure if it's the info you need.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Can you also post the dmesg output? You can run:

sudo dmesg > dmesg.out

And attach the dmesg.out file.

I just want to be sure the kernel is being built properly for your hardware.

Revision history for this message
Martin Storsjö (ub71a5bwc-6kfi2n-b69y0hv8h) wrote :

Ok, here's the dmesg output.

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

One more test kernel. This is a patched precise test kernel, that I built in a precise schroot:

http://kernel.ubuntu.com/~jsalisbury/lp1265024

Revision history for this message
Martin Storsjö (ub71a5bwc-6kfi2n-b69y0hv8h) wrote :

I can finally confirm that this kernel boots, and fixes the bug as the cherry-picked patch intended to do (making wine run windows/arm binaries properly).

(I still had to hack the .deb files to convert them from -armel to -armhf, but I just changed the architecture name in the .deb control file.)

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Thanks for testing and reporting back. Would it also be possible for you to test the Precise LTS backport kernel, which can be downloaded from:

https://launchpad.net/ubuntu/precise/+package/linux-generic-lts-saucy

It's possible the 3.2 upstream maintainer may not accept commit a4780ad because it requires a backport. Another solution would be to use the backport kernel if it is not accepted.

Revision history for this message
Martin Storsjö (ub71a5bwc-6kfi2n-b69y0hv8h) wrote :

I tested this one, but this one doesn't even get to "Uncompressing Linux".

If this can't be backported into the official packages I guess I'll just have to keep running kernels I build manually myself instead - that's probably no big issue either, until I update the whole distro to something that runs on >= 3.11.

Changed in linux-ti-omap4 (Ubuntu):
status: In Progress → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.