Comment 7 for bug 528377

Revision history for this message
In , Loïc Minier (lool) wrote :

Created an attachment (id=345551)
ARM cpuinfo parsing improvements dpatch

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.2) Gecko/20100222 Ubuntu/10.04 (lucid) Firefox/3.6

Hi

The mono ARM JIT implementation reads /proc/cpuinfo to check the family of the ARM CPU it's running on and whether it supports Thumb. When cpuinfo is missing or has data mono can't parse, it assumes non-thumb and <= ARMv4, and if you urn some thumb code, it triggers an assertion failure.

/proc/cpuinfo is typically missing in chroots if you don't mount /proc, and might have bogus data when using qemu-arm syscall emulation; the latter is clearly a qemu bug, but I think it makes sense to improve the cpudetection routine to handle the case where the data doesn't seem like it's an ARM CPU. The parsing is relatively weak in that it looks for "(v" in the Processor line and uses the digit after that to decide of the ARM family.

I'd like to propose merging the attached patch.

One important thing to keep in mind is that families older than ARMv4 (and in fact even some ARMv4 families) aren't supported anymore and all ARMv5 and later families have Thumb. So I believe the only case where we care that Thumb might not be enabled is when Processor is ARMv4 and Features lacks "thumb".

Thanks,

Reproducible: Always