<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/arch/mips/kernel/unaligned.c, branch v4.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-10-26T08:49:42Z</updated>
<entry>
<title>MIPS: Declare mips_debugfs_dir in a header</title>
<updated>2015-10-26T08:49:42Z</updated>
<author>
<name>Paul Burton</name>
<email>paul.burton@imgtec.com</email>
</author>
<published>2015-09-22T17:10:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=75dcfc1d678d76a82288c043bfd5bfc0fbd43b49'/>
<id>urn:sha1:75dcfc1d678d76a82288c043bfd5bfc0fbd43b49</id>
<content type='text'>
We have many extern declarations of mips_debugfs_dir through arch/mips/
in various C files. Unify them by declaring mips_debugfs_dir in a
header, including it in each affected C file &amp; removing the duplicate
declarations.

Signed-off-by: Paul Burton &lt;paul.burton@imgtec.com&gt;
Cc: linux-mips@linux-mips.org
Cc: Steven J. Hill &lt;Steven.Hill@imgtec.com&gt;
Cc: Alexander Sverdlin &lt;alexander.sverdlin@nokia.com&gt;
Cc: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Cc: Leonid Yegoshin &lt;Leonid.Yegoshin@imgtec.com&gt;
Cc: Maciej W. Rozycki &lt;macro@linux-mips.org&gt;
Cc: linux-kernel@vger.kernel.org
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Jaedon Shin &lt;jaedon.shin@gmail.com&gt;
Cc: James Hogan &lt;james.hogan@imgtec.com&gt;
Cc: David Daney &lt;david.daney@cavium.com&gt;
Cc: Zubair Lutfullah Kakakhel &lt;Zubair.Kakakhel@imgtec.com&gt;
Cc: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: James Cowgill &lt;James.Cowgill@imgtec.com&gt;
Patchwork: https://patchwork.linux-mips.org/patch/11181/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>MIPS: unaligned: Move from deprecated __initcall to arch_initcall.</title>
<updated>2015-09-03T10:07:49Z</updated>
<author>
<name>Ralf Baechle</name>
<email>ralf@linux-mips.org</email>
</author>
<published>2015-07-20T07:04:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8d6b591ce9b2706403b4c79d72c4483a7fbeda54'/>
<id>urn:sha1:8d6b591ce9b2706403b4c79d72c4483a7fbeda54</id>
<content type='text'>
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>MIPS: MSA unaligned memory access support</title>
<updated>2015-09-03T10:07:40Z</updated>
<author>
<name>Leonid Yegoshin</name>
<email>Leonid.Yegoshin@imgtec.com</email>
</author>
<published>2015-06-22T11:21:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e4aa1f153add29343eeb8b3bf0f64e7c6fc7e697'/>
<id>urn:sha1:e4aa1f153add29343eeb8b3bf0f64e7c6fc7e697</id>
<content type='text'>
The MSA architecture specification allows for hardware to not implement
unaligned vector memory accesses in some or all cases. A typical example
of this is the I6400 core which does not implement unaligned vector
memory access when the memory crosses a page boundary. The architecture
also requires that such memory accesses complete successfully as far as
userland is concerned, so the kernel is required to emulate them.

This patch implements support for emulating unaligned MSA ld &amp; st
instructions by copying between the user memory &amp; the tasks FP context
in struct thread_struct, updating hardware registers from there as
appropriate in order to avoid saving &amp; restoring the entire vector
context for each unaligned memory access.

Tested both using an I6400 CPU and with a QEMU build hacked to produce
AdEL exceptions for unaligned vector memory accesses.

[paul.burton@imgtec.com:
  - Remove #ifdef's
  - Move msa_op into enum major_op rather than #define
  - Replace msa_{to,from}_wd with {read,write}_msa_wr_{b,h,w,l} and the
    format-agnostic wrappers, removing the custom endian mangling for
    big endian systems.
  - Restructure the msa_op case in emulate_load_store_insn to share
    more code between the load &amp; store cases.
  - Avoid the need for a temporary union fpureg on the stack by simply
    reusing the already suitably aligned context in struct
    thread_struct.
  - Use sizeof(*fpr) rather than hardcoding 16 as the size for user
    memory checks &amp; copies.
  - Stop recalculating the address of the unaligned vector memory access
    and rely upon the value read from BadVAddr as we do for other
    unaligned memory access instructions.
  - Drop the now unused val8 &amp; val16 fields in union fpureg.
  - Rewrite commit message.
  - General formatting cleanups.]

Signed-off-by: Paul Burton &lt;paul.burton@imgtec.com&gt;
Cc: linux-mips@linux-mips.org
Cc: Leonid Yegoshin &lt;Leonid.Yegoshin@imgtec.com&gt;
Cc: Huacai Chen &lt;chenhc@lemote.com&gt;
Cc: Maciej W. Rozycki &lt;macro@linux-mips.org&gt;
Cc: linux-kernel@vger.kernel.org
Cc: Jie Chen &lt;chenj@lemote.com&gt;
Cc: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Patchwork: https://patchwork.linux-mips.org/patch/10573/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>MIPS: unaligned: Fix build error on big endian R6 kernels</title>
<updated>2015-08-03T07:25:05Z</updated>
<author>
<name>James Cowgill</name>
<email>James.Cowgill@imgtec.com</email>
</author>
<published>2015-06-23T11:02:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=531a6d599f4304156236ebdd531aaa80be61868d'/>
<id>urn:sha1:531a6d599f4304156236ebdd531aaa80be61868d</id>
<content type='text'>
Commit eeb538950367 ("MIPS: unaligned: Prevent EVA instructions on kernel
unaligned accesses") renamed the Load* and Store* defines in unaligned.c
to _Load* and _Store* as part of its fix. One define was missed out which
causes big endian R6 kernels to fail to build.

arch/mips/kernel/unaligned.c:880:35:
error: implicit declaration of function '_StoreDW'
 #define StoreDW(addr, value, res) _StoreDW(addr, value, res)
                                   ^

Signed-off-by: James Cowgill &lt;James.Cowgill@imgtec.com&gt;
Fixes: eeb538950367 ("MIPS: unaligned: Prevent EVA instructions on kernel unaligned accesses")
Cc: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # 4.0+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/10575/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>Merge branch '4.0-fixes' into mips-for-linux-next</title>
<updated>2015-04-13T14:03:32Z</updated>
<author>
<name>Ralf Baechle</name>
<email>ralf@linux-mips.org</email>
</author>
<published>2015-04-13T14:03:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3e20a26b02bd4f24945c87407df51948dd488620'/>
<id>urn:sha1:3e20a26b02bd4f24945c87407df51948dd488620</id>
<content type='text'>
</content>
</entry>
<entry>
<title>MIPS: unaligned: Fix regular load/store instruction emulation for EVA</title>
<updated>2015-04-10T13:41:45Z</updated>
<author>
<name>Markos Chandras</name>
<email>markos.chandras@imgtec.com</email>
</author>
<published>2015-03-09T14:54:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6eae35485b26f9e51ab896eb8a936bed9908fdf6'/>
<id>urn:sha1:6eae35485b26f9e51ab896eb8a936bed9908fdf6</id>
<content type='text'>
When emulating a regular lh/lw/lhu/sh/sw we need to use the appropriate
instruction if we are in EVA mode. This is necessary for userspace
applications which trigger alignment exceptions. In such case, the
userspace load/store instruction needs to be emulated with the correct
eva/non-eva instruction by the kernel emulator.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Fixes: c1771216ab48 ("MIPS: kernel: unaligned: Handle unaligned accesses for EVA")
Cc: &lt;stable@vger.kernel.org&gt; # v3.15+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9503/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>MIPS: unaligned: Surround load/store macros in do {} while statements</title>
<updated>2015-04-10T13:41:44Z</updated>
<author>
<name>Markos Chandras</name>
<email>markos.chandras@imgtec.com</email>
</author>
<published>2015-03-09T14:54:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3563c32d6532ece53c9dd8905a8e41983ef9952f'/>
<id>urn:sha1:3563c32d6532ece53c9dd8905a8e41983ef9952f</id>
<content type='text'>
It's best to surround such complex macros with do {} while statements
so they can appear as independent logical blocks when used within other
control blocks.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v3.15+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9502/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>MIPS: unaligned: Prevent EVA instructions on kernel unaligned accesses</title>
<updated>2015-04-10T13:41:44Z</updated>
<author>
<name>Markos Chandras</name>
<email>markos.chandras@imgtec.com</email>
</author>
<published>2015-03-09T14:54:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eeb538950367e3966cbf0237ab1a1dc30e059818'/>
<id>urn:sha1:eeb538950367e3966cbf0237ab1a1dc30e059818</id>
<content type='text'>
Commit c1771216ab48 ("MIPS: kernel: unaligned: Handle unaligned
accesses for EVA") allowed unaligned accesses to be emulated for
EVA. However, when emulating regular load/store unaligned accesses,
we need to use the appropriate "address space" instructions for that.
Previously, an unaligned load/store instruction in kernel space would
have used the corresponding EVA instructions to emulate it which led to
segmentation faults because of the address translation that happens
with EVA instructions. This is now fixed by using the EVA instruction
only when emulating EVA unaligned accesses.

Signed-off-by: Markos Chandras &lt;markos.chandras@imgtec.com&gt;
Fixes: c1771216ab48 ("MIPS: kernel: unaligned: Handle unaligned accesses for EVA")
Cc: &lt;stable@vger.kernel.org&gt; # v3.15+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9501/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>MIPS: Fix double inclusion of headers in misalignment emulator.</title>
<updated>2015-04-07T23:10:49Z</updated>
<author>
<name>Ralf Baechle</name>
<email>ralf@linux-mips.org</email>
</author>
<published>2015-04-07T12:59:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8af2f6967cb9eeedb0f85979a8c20a59a6332d50'/>
<id>urn:sha1:8af2f6967cb9eeedb0f85979a8c20a59a6332d50</id>
<content type='text'>
Introduced in 34c2f668d0f6b2ca1c076d8170d6cd4f2235a9d4 (MIPS: microMIPS:
Add unaligned access support.)

Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
<entry>
<title>MIPS: Set `si_code' for SIGFPE signals sent from emulation too</title>
<updated>2015-04-07T23:10:19Z</updated>
<author>
<name>Maciej W. Rozycki</name>
<email>macro@linux-mips.org</email>
</author>
<published>2015-04-03T22:27:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=304acb717e5b67cf56f05bc5b21123758e1f7ea0'/>
<id>urn:sha1:304acb717e5b67cf56f05bc5b21123758e1f7ea0</id>
<content type='text'>
Rework `process_fpemu_return' and move IEEE 754 exception interpretation
there, from `do_fpe'.  Record the cause bits set in FCSR before they are
cleared and pass them through to `process_fpemu_return' so as to set
`si_code' correctly too for SIGFPE signals sent from emulation rather
than those issued by hardware with the FPE processor exception only.

For simplicity `mipsr2_decoder' assumes `*fcr31' has been preinitialised
and only sets it to anything if an FPU instruction has been emulated,
which in turn is the only case SIGFPE can be issued for here.

Signed-off-by: Maciej W. Rozycki &lt;macro@linux-mips.org&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9705/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
</entry>
</feed>
