<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/kernel/hw_breakpoint.c, branch linux-6.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.1.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.1.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-10-06T12:56:57Z</updated>
<entry>
<title>powerpc/watchpoints: Annotate atomic context in more places</title>
<updated>2023-10-06T12:56:57Z</updated>
<author>
<name>Benjamin Gray</name>
</author>
<published>2023-08-29T06:34:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c93aa8cfaec493e21aed78438f7cfb341fdaec12'/>
<id>urn:sha1:c93aa8cfaec493e21aed78438f7cfb341fdaec12</id>
<content type='text'>
[ Upstream commit 27646b2e02b096a6936b3e3b6ba334ae20763eab ]

It can be easy to miss that the notifier mechanism invokes the callbacks
in an atomic context, so add some comments to that effect on the two
handlers we register here.

Signed-off-by: Benjamin Gray &lt;bgray@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230829063457.54157-4-bgray@linux.ibm.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>powerpc/watchpoints: Disable preemption in thread_change_pc()</title>
<updated>2023-10-06T12:56:57Z</updated>
<author>
<name>Benjamin Gray</name>
</author>
<published>2023-08-29T06:34:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=16722418cbe31400a4ab2ebab05ca2cb305c68e4'/>
<id>urn:sha1:16722418cbe31400a4ab2ebab05ca2cb305c68e4</id>
<content type='text'>
[ Upstream commit cc879ab3ce39bc39f9b1d238b283f43a5f6f957d ]

thread_change_pc() uses CPU local data, so must be protected from
swapping CPUs while it is reading the breakpoint struct.

The error is more noticeable after 1e60f3564bad ("powerpc/watchpoints:
Track perf single step directly on the breakpoint"), which added an
unconditional __this_cpu_read() call in thread_change_pc(). However the
existing __this_cpu_read() that runs if a breakpoint does need to be
re-inserted has the same issue.

Signed-off-by: Benjamin Gray &lt;bgray@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230829063457.54157-2-bgray@linux.ibm.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>powerpc/hw_breakpoint: Avoid relying on caller synchronization</title>
<updated>2022-08-30T08:56:23Z</updated>
<author>
<name>Marco Elver</name>
</author>
<published>2022-08-29T12:47:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f95e5a3d59011eec1257d0e76de1e1f8969d426f'/>
<id>urn:sha1:f95e5a3d59011eec1257d0e76de1e1f8969d426f</id>
<content type='text'>
Internal data structures (cpu_bps, task_bps) of powerpc's hw_breakpoint
implementation have relied on nr_bp_mutex serializing access to them.

Before overhauling synchronization of kernel/events/hw_breakpoint.c,
introduce 2 spinlocks to synchronize cpu_bps and task_bps respectively,
thus avoiding reliance on callers synchronizing powerpc's hw_breakpoint.

Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Marco Elver &lt;elver@google.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Acked-by: Ian Rogers &lt;irogers@google.com&gt;
Link: https://lore.kernel.org/r/20220829124719.675715-10-elver@google.com
</content>
</entry>
<entry>
<title>powerpc/inst: Define ppc_inst_t</title>
<updated>2021-12-09T11:41:21Z</updated>
<author>
<name>Christophe Leroy</name>
</author>
<published>2021-11-29T17:49:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c545b9f040f341038d5228932140fb17e0c156e2'/>
<id>urn:sha1:c545b9f040f341038d5228932140fb17e0c156e2</id>
<content type='text'>
In order to stop using 'struct ppc_inst' on PPC32,
define a ppc_inst_t typedef.

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/fe5baa2c66fea9db05a8b300b3e8d2880a42596c.1638208156.git.christophe.leroy@csgroup.eu

</content>
</entry>
<entry>
<title>powerpc: rename powerpc_debugfs_root to arch_debugfs_dir</title>
<updated>2021-08-13T12:04:26Z</updated>
<author>
<name>Aneesh Kumar K.V</name>
</author>
<published>2021-08-12T13:28:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dbf77fed8b302e87561c7c2fc06050c88f4d3120'/>
<id>urn:sha1:dbf77fed8b302e87561c7c2fc06050c88f4d3120</id>
<content type='text'>
No functional change in this patch. arch_debugfs_dir is the generic kernel
name declared in linux/debugfs.h for arch-specific debugfs directory.
Architectures like x86/s390 already use the name. Rename powerpc
specific powerpc_debugfs_root to arch_debugfs_dir.

Signed-off-by: Aneesh Kumar K.V &lt;aneesh.kumar@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20210812132831.233794-2-aneesh.kumar@linux.ibm.com

</content>
</entry>
<entry>
<title>powerpc/64s: avoid reloading (H)SRR registers if they are still valid</title>
<updated>2021-06-24T14:06:55Z</updated>
<author>
<name>Nicholas Piggin</name>
</author>
<published>2021-06-17T15:51:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=59dc5bfca0cb6a29db1a50847684eb5c19f8f400'/>
<id>urn:sha1:59dc5bfca0cb6a29db1a50847684eb5c19f8f400</id>
<content type='text'>
When an interrupt is taken, the SRR registers are set to return to where
it left off. Unless they are modified in the meantime, or the return
address or MSR are modified, there is no need to reload these registers
when returning from interrupt.

Introduce per-CPU flags that track the validity of SRR and HSRR
registers. These are cleared when returning from interrupt, when
using the registers for something else (e.g., OPAL calls), when
adjusting the return address or MSR of a context, and when context
switching (which changes the return address and MSR).

This improves the performance of interrupt returns.

Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
[mpe: Fold in fixup patch from Nick]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20210617155116.2167984-5-npiggin@gmail.com

</content>
</entry>
<entry>
<title>powerpc/watchpoint: Workaround P10 DD1 issue with VSX-32 byte instructions</title>
<updated>2020-12-10T13:09:10Z</updated>
<author>
<name>Ravi Bangoria</name>
</author>
<published>2020-11-06T04:56:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3d2ffcdd2a982e8bbe65fa0f94fb21bf304c281e'/>
<id>urn:sha1:3d2ffcdd2a982e8bbe65fa0f94fb21bf304c281e</id>
<content type='text'>
POWER10 DD1 has an issue where it generates watchpoint exceptions when
it shouldn't. The conditions where this occur are:

 - octword op
 - ending address of DAWR range is less than starting address of op
 - those addresses need to be in the same or in two consecutive 512B
   blocks
 - 'op address + 64B' generates an address that has a carry into bit
   52 (crosses 2K boundary)

Handle such spurious exception by considering them as extraneous and
emulating/single-steeping instruction without generating an event.

[ravi: Fixed build warning reported by lkp@intel.com]
Signed-off-by: Ravi Bangoria &lt;ravi.bangoria@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20201106045650.278987-1-ravi.bangoria@linux.ibm.com
</content>
</entry>
<entry>
<title>powerpc/watchpoint: Move DAWR detection logic outside of hw_breakpoint.c</title>
<updated>2020-09-15T12:13:19Z</updated>
<author>
<name>Ravi Bangoria</name>
</author>
<published>2020-09-02T04:29:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=edc8dd99b29e4d705c45e2a3a6c01b096ee056db'/>
<id>urn:sha1:edc8dd99b29e4d705c45e2a3a6c01b096ee056db</id>
<content type='text'>
Power10 hw has multiple DAWRs but hw doesn't tell which DAWR caused
the exception. So we have a sw logic to detect that in hw_breakpoint.c.
But hw_breakpoint.c gets compiled only with CONFIG_HAVE_HW_BREAKPOINT=Y.
Move DAWR detection logic outside of hw_breakpoint.c so that it can be
reused when CONFIG_HAVE_HW_BREAKPOINT is not set.

Signed-off-by: Ravi Bangoria &lt;ravi.bangoria@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200902042945.129369-5-ravi.bangoria@linux.ibm.com
</content>
</entry>
<entry>
<title>powerpc/watchpoint: Fix handling of vector instructions</title>
<updated>2020-09-15T12:13:18Z</updated>
<author>
<name>Ravi Bangoria</name>
</author>
<published>2020-09-02T04:29:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4441eb02333a9b46a0d919aa7a6d3b137b5f2562'/>
<id>urn:sha1:4441eb02333a9b46a0d919aa7a6d3b137b5f2562</id>
<content type='text'>
Vector load/store instructions are special because they are always
aligned. Thus unaligned EA needs to be aligned down before comparing
it with watch ranges. Otherwise we might consider valid event as
invalid.

Fixes: 74c6881019b7 ("powerpc/watchpoint: Prepare handler to handle more than one watchpoint")
Signed-off-by: Ravi Bangoria &lt;ravi.bangoria@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200902042945.129369-3-ravi.bangoria@linux.ibm.com
</content>
</entry>
<entry>
<title>powerpc/watchpoint: Fix quadword instruction handling on p10 predecessors</title>
<updated>2020-09-15T12:12:25Z</updated>
<author>
<name>Ravi Bangoria</name>
</author>
<published>2020-09-02T04:29:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4759c11ed20454b7b36db4ec15f7d5aa1519af4a'/>
<id>urn:sha1:4759c11ed20454b7b36db4ec15f7d5aa1519af4a</id>
<content type='text'>
On p10 predecessors, watchpoint with quadword access is compared at
quadword length. If the watch range is doubleword or less than that
in a first half of quadword aligned 16 bytes, and if there is any
unaligned quadword access which will access only the 2nd half, the
handler should consider it as extraneous and emulate/single-step it
before continuing.

Fixes: 74c6881019b7 ("powerpc/watchpoint: Prepare handler to handle more than one watchpoint")
Reported-by: Pedro Miraglia Franco de Carvalho &lt;pedromfc@linux.ibm.com&gt;
Signed-off-by: Ravi Bangoria &lt;ravi.bangoria@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200902042945.129369-2-ravi.bangoria@linux.ibm.com
</content>
</entry>
</feed>
