<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/parisc/kernel/traps.c, branch linux-5.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-04-08T12:06:34Z</updated>
<entry>
<title>parisc: Fix handling off probe non-access faults</title>
<updated>2022-04-08T12:06:34Z</updated>
<author>
<name>John David Anglin</name>
</author>
<published>2022-03-09T21:14:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a354b5a1db54284b94bb768077c760a8b938ec1'/>
<id>urn:sha1:3a354b5a1db54284b94bb768077c760a8b938ec1</id>
<content type='text'>
[ Upstream commit e00b0a2ab8ec019c344e53bfc76e31c18bb587b7 ]

Currently, the parisc kernel does not fully support non-access TLB
fault handling for probe instructions. In the fast path, we set the
target register to zero if it is not a shadowed register. The slow
path is not implemented, so we call do_page_fault. The architecture
indicates that non-access faults should not cause a page fault from
disk.

This change adds to code to provide non-access fault support for
probe instructions. It also modifies the handling of faults on
userspace so that if the address lies in a valid VMA and the access
type matches that for the VMA, the probe target register is set to
one. Otherwise, the target register is set to zero.

This was done to make probe instructions more useful for userspace.
Probe instructions are not very useful if they set the target register
to zero whenever a page is not present in memory. Nominally, the
purpose of the probe instruction is determine whether read or write
access to a given address is allowed.

This fixes a problem in function pointer comparison noticed in the
glibc testsuite (stdio-common/tst-vfprintf-user-type). The same
problem is likely in glibc (_dl_lookup_address).

V2 adds flush and lpa instruction support to handle_nadtlb_fault.

Signed-off-by: John David Anglin &lt;dave.anglin@bell.net&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>parisc: Avoid calling faulthandler_disabled() twice</title>
<updated>2022-01-27T11:02:31Z</updated>
<author>
<name>John David Anglin</name>
</author>
<published>2021-12-22T16:52:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=228838dc4d5513750fb144867a013b77ac82f626'/>
<id>urn:sha1:228838dc4d5513750fb144867a013b77ac82f626</id>
<content type='text'>
[ Upstream commit 9e9d4b460f23bab61672eae397417d03917d116c ]

In handle_interruption(), we call faulthandler_disabled() to check whether the
fault handler is not disabled. If the fault handler is disabled, we immediately
call do_page_fault(). It then calls faulthandler_disabled(). If disabled,
do_page_fault() attempts to fixup the exception by jumping to no_context:

no_context:

        if (!user_mode(regs) &amp;&amp; fixup_exception(regs)) {
                return;
        }

        parisc_terminate("Bad Address (null pointer deref?)", regs, code, address);

Apart from the error messages, the two blocks of code perform the same
function.

We can avoid two calls to faulthandler_disabled() by a simple revision
to the code in handle_interruption().

Note: I didn't try to fix the formatting of this code block.

Signed-off-by: John David Anglin &lt;dave.anglin@bell.net&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>parisc: Clear stale IIR value on instruction access rights trap</title>
<updated>2021-12-20T13:38:40Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2021-12-08T10:06:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=484730e5862f6b872dca13840bed40fd7c60fa26'/>
<id>urn:sha1:484730e5862f6b872dca13840bed40fd7c60fa26</id>
<content type='text'>
When a trap 7 (Instruction access rights) occurs, this means the CPU
couldn't execute an instruction due to missing execute permissions on
the memory region.  In this case it seems the CPU didn't even fetched
the instruction from memory and thus did not store it in the cr19 (IIR)
register before calling the trap handler. So, the trap handler will find
some random old stale value in cr19.

This patch simply overwrites the stale IIR value with a constant magic
"bad food" value (0xbaadf00d), in the hope people don't start to try to
understand the various random IIR values in trap 7 dumps.

Noticed-by: John David Anglin &lt;dave.anglin@bell.net&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: don't enable irqs unconditionally in handle_interruption()</title>
<updated>2021-11-04T10:21:20Z</updated>
<author>
<name>Sven Schnelle</name>
</author>
<published>2021-10-15T19:56:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=014966dcf76bce5717f7d974d0410d3402a651c2'/>
<id>urn:sha1:014966dcf76bce5717f7d974d0410d3402a651c2</id>
<content type='text'>
If the previous context had interrupts disabled, we should better
keep them disabled. This was noticed in the unwinding code where
a copy_from_kernel_nofault() triggered a page fault, and after
the fixup by the page fault handler interrupts where suddenly
enabled.

Signed-off-by: Sven Schnelle &lt;svens@stackframe.org&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>parisc: Move thread_info into task struct</title>
<updated>2021-11-01T06:35:59Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2021-10-15T08:41:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2214c0e77259b420402e279e9ab4277ef320d371'/>
<id>urn:sha1:2214c0e77259b420402e279e9ab4277ef320d371</id>
<content type='text'>
This implements the CONFIG_THREAD_INFO_IN_TASK option.

With this change:
- before thread_info was part of the stack and located at the beginning of the stack
- now the thread_info struct is moved and located inside the task_struct structure
- the stack is allocated and handled like the major other platforms
- drop the cpu field of thread_info and use instead the one in task_struct

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Sven Schnelle &lt;svens@stackframe.org&gt;
</content>
</entry>
<entry>
<title>parisc: Add KFENCE support</title>
<updated>2021-10-30T21:11:00Z</updated>
<author>
<name>Helge Deller</name>
</author>
<published>2021-10-09T20:21:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ec5c115050f59114e216212837f1c1ebc54bdfc9'/>
<id>urn:sha1:ec5c115050f59114e216212837f1c1ebc54bdfc9</id>
<content type='text'>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>trap: cleanup trap_init()</title>
<updated>2021-09-08T18:50:27Z</updated>
<author>
<name>Kefeng Wang</name>
</author>
<published>2021-09-08T03:16:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8b097881b54cbc23dd78262ed88c9924d00ea457'/>
<id>urn:sha1:8b097881b54cbc23dd78262ed88c9924d00ea457</id>
<content type='text'>
There are some empty trap_init() definitions in different ARCHs, Introduce
a new weak trap_init() function to clean them up.

Link: https://lkml.kernel.org/r/20210812123602.76356-1-wangkefeng.wang@huawei.com
Signed-off-by: Kefeng Wang &lt;wangkefeng.wang@huawei.com&gt;
Acked-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;	[arm32]
Acked-by: Vineet Gupta						[arc]
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;			[powerpc]
Cc: Yoshinori Sato &lt;ysato@users.sourceforge.jp&gt;
Cc: Ley Foon Tan &lt;ley.foon.tan@intel.com&gt;
Cc: Jonas Bonn &lt;jonas@southpole.se&gt;
Cc: Stefan Kristiansson &lt;stefan.kristiansson@saunalahti.fi&gt;
Cc: Stafford Horne &lt;shorne@gmail.com&gt;
Cc: James E.J. Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Cc: Helge Deller &lt;deller@gmx.de&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Paul Walmsley &lt;palmerdabbelt@google.com&gt;
Cc: Jeff Dike &lt;jdike@addtoit.com&gt;
Cc: Richard Weinberger &lt;richard@nod.at&gt;
Cc: Anton Ivanov &lt;anton.ivanov@cambridgegreys.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>parisc: Fix IVT checksum calculation wrt HPMC</title>
<updated>2021-02-12T15:31:42Z</updated>
<author>
<name>Sven Schnelle</name>
</author>
<published>2020-10-02T18:07:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c70919bd9d0782a6078ccd37d7f861d514f5481e'/>
<id>urn:sha1:c70919bd9d0782a6078ccd37d7f861d514f5481e</id>
<content type='text'>
On my C8000 a HPMC was triggered, but the HPMC handler wasn't called.
I got the following chassis codes:

&lt;Cpu2&gt; e800009802e00000  0000000000000000  CC_ERR_CHECK_HPMC
&lt;Cpu3&gt; e800009803e00000  00000000001b28a3  CC_ERR_CHECK_HPMC
&lt;Cpu2&gt; 37000f7302e00000  8400000000800000  CC_ERR_CPU_CHECK_SUMMARY
&lt;Cpu3&gt; 37000f7303e00000  8400000000800000  CC_ERR_CPU_CHECK_SUMMARY
&lt;Cpu2&gt; f600105e02e00000  fffffff0f0c00000  CC_MC_HPMC_MONARCH_SELECTED
&lt;Cpu3&gt; 5600100b03e00000  00000000000001a0  CC_MC_OS_HPMC_LEN_ERR
&lt;Cpu2&gt; 140003b202e00000  000000000000000b  CC_ERR_HPMC_STATE_ENTRY
&lt;Cpu3&gt; 5600106403e00000  fffffff0f043ad20  CC_MC_BR_TO_OS_HPMC_FAILED
&lt;Cpu3&gt; 160012cf03e00000  030001001e000007  CC_MPS_CPU_WAITING
&lt;Cpu2&gt; 5600100b02e00000  00000000000001a0  CC_MC_OS_HPMC_LEN_ERR
&lt;Cpu2&gt; 5600106402e00000  fffffff0f0438e70  CC_MC_BR_TO_OS_HPMC_FAILED
&lt;Cpu2&gt; e800009802e00000  0000000000000000  CC_ERR_CHECK_HPMC
&lt;Cpu2&gt; 37000f7302e00000  8400000000800000  CC_ERR_CPU_CHECK_SUMMARY
&lt;Cpu2&gt; 4000109f02e00000  0000000000000000  CC_MC_HPMC_INITIATED
&lt;Cpu2&gt; 4000101902e00000  0000000000000000  CC_MC_MULTIPLE_HPMCS
&lt;Cpu2&gt; 030010d502e00000  0000000000000000  CC_CPU_STOP

C8000 PDC is complaining about our HPMC handler length, which is 1a0 (second
part of the chassis code). Changing that to 0 makes the error go away:

&lt;Cpu0&gt; e800009800e00000  0000000000000000  CC_ERR_CHECK_HPMC
&lt;Cpu3&gt; e800009803e00000  0000000000000000  CC_ERR_CHECK_HPMC
&lt;Cpu1&gt; e800009801e00000  0000000000000000  CC_ERR_CHECK_HPMC
&lt;Cpu2&gt; e800009802e00000  0000000000000000  CC_ERR_CHECK_HPMC
&lt;Cpu0&gt; 37000f7300e00000  8060004000000000  CC_ERR_CPU_CHECK_SUMMARY
&lt;Cpu3&gt; 37000f7303e00000  8060004000000000  CC_ERR_CPU_CHECK_SUMMARY
&lt;Cpu1&gt; 37000f7301e00000  8060004000000000  CC_ERR_CPU_CHECK_SUMMARY
&lt;Cpu2&gt; 37000f7302e00000  8060004000000000  CC_ERR_CPU_CHECK_SUMMARY
&lt;Cpu0&gt; f600105e00e00000  fffffff0f0c00000  CC_MC_HPMC_MONARCH_SELECTED
&lt;Cpu3&gt; 5600109b03e00000  00000000001eb024  CC_MC_BR_TO_OS_HPMC
&lt;Cpu1&gt; 5600109b01e00000  00000000001eb024  CC_MC_BR_TO_OS_HPMC
&lt;Cpu2&gt; 5600109b02e00000  00000000001eb024  CC_MC_BR_TO_OS_HPMC
&lt;Cpu0&gt; 140003b200e00000  000000000000000b  CC_ERR_HPMC_STATE_ENTRY
&lt;Cpu3&gt; 0000000003000000  0000000000000000
&lt;Cpu1&gt; 0000000001000000  0000000000000000
&lt;Cpu2&gt; 0000000002000000  0000000000000000
&lt;Cpu0&gt; 5600109b00e00000  00000000001eb024  CC_MC_BR_TO_OS_HPMC
&lt;Cpu0&gt; 0000000000000000  0000000000000000

So at least the HPMC handler is now called, but it hangs. Which isn't really
suprising, as the code has at least one comment saying it can't handle multiple
CPUs, and here the handler is called on all CPUs. And i'm not sure whether it
can handle 64 Bit.

So despite what the PDC spec says, C8000 and RP34xx/RP44xx don't want the
OS_HPMC length in the vector set, which is odd. I disassembled the firmware and
it actually looks like a Bug in PDC.

Signed-off-by: Sven Schnelle &lt;svens@stackframe.org&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
<entry>
<title>treewide: Use fallthrough pseudo-keyword</title>
<updated>2020-08-23T22:36:59Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
</author>
<published>2020-08-23T22:36:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=df561f6688fef775baa341a0f5d960becd248b11'/>
<id>urn:sha1:df561f6688fef775baa341a0f5d960becd248b11</id>
<content type='text'>
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
</content>
</entry>
<entry>
<title>parisc: make the log level string for register dumps const</title>
<updated>2020-08-04T14:22:53Z</updated>
<author>
<name>Rolf Eike Beer</name>
</author>
<published>2020-06-22T18:47:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e2693ec1e0a12a6dc601e4dfe9b6f714b92f6954'/>
<id>urn:sha1:e2693ec1e0a12a6dc601e4dfe9b6f714b92f6954</id>
<content type='text'>
Signed-off-by: Rolf Eike Beer &lt;eike-kernel@sf-tec.de&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
</entry>
</feed>
