<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arm/mm/alignment.c, branch linux-3.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.2.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.2.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-11-05T20:27:46Z</updated>
<entry>
<title>ARM: 8165/1: alignment: don't break misaligned NEON load/store</title>
<updated>2014-11-05T20:27:46Z</updated>
<author>
<name>Robin Murphy</name>
</author>
<published>2014-09-25T10:56:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=edeb8f82dff6d09343e0ec195edae6ed19d6423e'/>
<id>urn:sha1:edeb8f82dff6d09343e0ec195edae6ed19d6423e</id>
<content type='text'>
commit 5ca918e5e3f9df4634077c06585c42bc6a8d699a upstream.

The alignment fixup incorrectly decodes faulting ARM VLDn/VSTn
instructions (where the optional alignment hint is given but incorrect)
as LDR/STR, leading to register corruption. Detect these and correctly
treat them as unhandled, so that userspace gets the fault it expects.

Reported-by: Simon Hosie &lt;simon.hosie@arm.com&gt;
Signed-off-by: Robin Murphy &lt;robin.murphy@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: fix scheduling while atomic warning in alignment handling code</title>
<updated>2013-03-20T15:03:17Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2013-02-25T16:10:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b923f0d70914a257e4545ede4155f9889acc653b'/>
<id>urn:sha1:b923f0d70914a257e4545ede4155f9889acc653b</id>
<content type='text'>
commit b255188f90e2bade1bd11a986dd1ca4861869f4d upstream.

Paolo Pisati reports that IPv6 triggers this warning:

BUG: scheduling while atomic: swapper/0/0/0x40000100
Modules linked in:
[&lt;c001b1c4&gt;] (unwind_backtrace+0x0/0xf0) from [&lt;c0503c5c&gt;] (__schedule_bug+0x48/0x5c)
[&lt;c0503c5c&gt;] (__schedule_bug+0x48/0x5c) from [&lt;c0508608&gt;] (__schedule+0x700/0x740)
[&lt;c0508608&gt;] (__schedule+0x700/0x740) from [&lt;c007007c&gt;] (__cond_resched+0x24/0x34)
[&lt;c007007c&gt;] (__cond_resched+0x24/0x34) from [&lt;c05086dc&gt;] (_cond_resched+0x3c/0x44)
[&lt;c05086dc&gt;] (_cond_resched+0x3c/0x44) from [&lt;c0021f6c&gt;] (do_alignment+0x178/0x78c)
[&lt;c0021f6c&gt;] (do_alignment+0x178/0x78c) from [&lt;c00083e0&gt;] (do_DataAbort+0x34/0x98)
[&lt;c00083e0&gt;] (do_DataAbort+0x34/0x98) from [&lt;c0509a60&gt;] (__dabt_svc+0x40/0x60)
Exception stack(0xc0763d70 to 0xc0763db8)
3d60:                                     e97e805e e97e806e 2c000000 11000000
3d80: ea86bb00 0000002c 00000011 e97e807e c076d2a8 e97e805e e97e806e 0000002c
3da0: 3d000000 c0763dbc c04b98fc c02a8490 00000113 ffffffff
[&lt;c0509a60&gt;] (__dabt_svc+0x40/0x60) from [&lt;c02a8490&gt;] (__csum_ipv6_magic+0x8/0xc8)

Fix this by using probe_kernel_address() stead of __get_user().

Reported-by: Paolo Pisati &lt;p.pisati@gmail.com&gt;
Tested-by: Paolo Pisati &lt;p.pisati@gmail.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: allow building alignment.c without PROC_FS</title>
<updated>2011-10-01T19:08:54Z</updated>
<author>
<name>Arnd Bergmann</name>
</author>
<published>2011-08-27T18:01:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ffc660c51b66312938e25fd6af24e3defdd0bc1b'/>
<id>urn:sha1:ffc660c51b66312938e25fd6af24e3defdd0bc1b</id>
<content type='text'>
The two functions cpu_is_v6_unaligned and safe_usermode
are only defined when CONFIG_PROC_FS is enabled, but
are used outside of the #ifdef.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Dave Martin &lt;dave.martin@linaro.org&gt;
</content>
</entry>
<entry>
<title>ARM: 7008/1: alignment: Make SIGBUS sent to userspace POSIXly correct</title>
<updated>2011-08-09T07:42:39Z</updated>
<author>
<name>Dave Martin</name>
</author>
<published>2011-07-28T13:29:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2102a65e69eac8d77dd71b4991b395e825087ba8'/>
<id>urn:sha1:2102a65e69eac8d77dd71b4991b395e825087ba8</id>
<content type='text'>
With the UM_SIGNAL alignment fault mode, no siginfo structure is
passed to userspace.

POSIX specifies how siginfo_t should be populated for alignment
faults, so this patch does just that:

  * si_signo = SIGBUS
  * si_code = BUS_ADRALN
  * si_addr = misaligned data address at which access was attempted

Signed-off-by: Dave Martin &lt;dave.martin@linaro.org&gt;
Acked-by: Nicolas Pitre &lt;nicolas.pitre@linaro.org&gt;
Acked-by: Kirill A. Shutemov &lt;kirill@shutemov.name&gt;
Reviewed-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 7007/1: alignment: Prevent ignoring of faults with ARMv6 unaligned access model</title>
<updated>2011-08-09T07:42:39Z</updated>
<author>
<name>Dave Martin</name>
</author>
<published>2011-07-28T13:28:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=088c01f1e39dbe93a13e0b00f4532ed8b79d35f4'/>
<id>urn:sha1:088c01f1e39dbe93a13e0b00f4532ed8b79d35f4</id>
<content type='text'>
Currently, it's possible to set the kernel to ignore alignment
faults when changing the alignment fault handling mode at runtime
via /proc/sys/alignment, even though this is undesirable on ARMv6
and above, where it can result in infinite spins where an un-fixed-
up instruction repeatedly faults.

In addition, the kernel clobbers any alignment mode specified on
the command-line if running on ARMv6 or above.

This patch factors out the necessary safety check into a couple of
new helper functions, and checks and modifies the fault handling
mode as appropriate on boot and on writes to /proc/cpu/alignment.

Prior to ARMv6, the behaviour is unchanged.

For ARMv6 and above, the behaviour changes as follows:

  * Attempting to ignore faults on ARMv6 results in the mode being
    forced to UM_FIXUP instead.  A warning is printed if this
    happened as a result of a write to /proc/cpu/alignment.  The
    user's UM_WARN bit (if present) is still honoured.

  * An alignment= argument from the kernel command-line is now
    honoured, except that the kernel will modify the specified mode
    as described above.  This is allows modes such as UM_SIGNAL and
    UM_WARN to be active immediately from boot, which is useful for
    debugging purposes.

Signed-off-by: Dave Martin &lt;dave.martin@linaro.org&gt;
Acked-by: Nicolas Pitre &lt;nicolas.pitre@linaro.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: entry: avoid enabling interrupts in prefetch/data abort handlers</title>
<updated>2011-07-02T09:56:00Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2011-06-25T10:44:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=02fe2845d6a837ab02f0738f6cf4591a02cc88d4'/>
<id>urn:sha1:02fe2845d6a837ab02f0738f6cf4591a02cc88d4</id>
<content type='text'>
Avoid enabling interrupts if the parent context had interrupts enabled
in the abort handler assembly code, and move this into the breakpoint/
page/alignment fault handlers instead.

This gets rid of some special-casing for the breakpoint fault handlers
from the low level abort handler path.

Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 6401/1: plug a race in the alignment trap handler</title>
<updated>2010-09-23T14:17:04Z</updated>
<author>
<name>Nicolas Pitre</name>
</author>
<published>2010-09-20T03:10:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2f27bf834e1d0a06e83d7458b535891c552271aa'/>
<id>urn:sha1:2f27bf834e1d0a06e83d7458b535891c552271aa</id>
<content type='text'>
When the policy for user space is to ignore misaligned accesses from user
space, the processor then performs a documented rotation on the accessed
data.  This is the result of the access being trapped, and the kernel
disabling the alignment trap before returning to user space again.

In kernel space we always want misaligned accesses to be fixed up.  This
is enforced by always re-enabling the alignment trap on every entry into
kernel space from user space.  No such re-enabling is performed when an
exception occurs while already in kernel space as the alignment trap is
always supposed to be enabled in that case.

There is however a small race window when a misaligned access in user
space is trapped and the alignment trap disabled, but the CPU didn't
return to user space just yet.  Any exception would be entered from kernel
space at that point and the kernel would then execute with the alignment
trap disabled.

Thanks to Maxime Bizon &lt;mbizon@freebox.fr&gt; for providing a test module
that made this issue reproducible.

Signed-off-by: Nicolas Pitre &lt;nicolas.pitre@linaro.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 6268/1: ARMv6K and ARMv7 use fault statuses 3 and 6 as Access Flag fault</title>
<updated>2010-07-27T09:48:41Z</updated>
<author>
<name>Kirill A. Shutemov</name>
</author>
<published>2010-07-26T10:20:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b8ab5397bcbd92e3fd4a9770e0bf59315fa38dab'/>
<id>urn:sha1:b8ab5397bcbd92e3fd4a9770e0bf59315fa38dab</id>
<content type='text'>
Statuses 3 (0b00011) and 6 (0x00110) of DFSR are Access Flags faults on
ARMv6K and ARMv7. Let's patch fsr_info[] at runtime if we are on ARMv7
or later.

Unfortunately, we don't have runtime check for 'K' extension, so we
can't check for it.

Signed-off-by: Kirill A. Shutemov &lt;kirill@shutemov.name&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 6269/1: Add 'code' parameter for hook_fault_code()</title>
<updated>2010-07-27T09:48:34Z</updated>
<author>
<name>Kirill A. Shutemov</name>
</author>
<published>2010-07-22T12:18:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6338a6aa7c082f11d55712251e14178c68bf5869'/>
<id>urn:sha1:6338a6aa7c082f11d55712251e14178c68bf5869</id>
<content type='text'>
Add one more parameter to hook_fault_code() to be able to set 'code'
field of struct fsr_info.

Signed-off-by: Kirill A. Shutemov &lt;kirill@shutemov.name&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: 6252/1: Use SIGBUS for unaligned access instead of SIGILL</title>
<updated>2010-07-27T09:43:49Z</updated>
<author>
<name>Kirill A. Shutemov</name>
</author>
<published>2010-07-22T12:16:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3dc91aff9c3ef54b15cdaf32f61f973489fe69eb'/>
<id>urn:sha1:3dc91aff9c3ef54b15cdaf32f61f973489fe69eb</id>
<content type='text'>
POSIX specify to use signal SIGBUS with code BUS_ADRALN for invalid
address alignment.

Signed-off-by: Kirill A. Shutemov &lt;kirill@shutemov.name&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
</feed>
