<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/arch/sparc/lib, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-10-15T10:00:14+00:00</updated>
<entry>
<title>sparc: fix accurate exception reporting in copy_{from,to}_user for M7</title>
<updated>2025-10-15T10:00:14+00:00</updated>
<author>
<name>Michael Karcher</name>
<email>kernel@mkarcher.dialup.fu-berlin.de</email>
</author>
<published>2025-09-04T22:03:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c31cb4df701bb2f4af77921efdfbc6837f5879b1'/>
<id>urn:sha1:c31cb4df701bb2f4af77921efdfbc6837f5879b1</id>
<content type='text'>
[ Upstream commit 936fb512752af349fc30ccbe0afe14a2ae6d7159 ]

The referenced commit introduced exception handlers on user-space memory
references in copy_from_user and copy_to_user. These handlers return from
the respective function and calculate the remaining bytes left to copy
using the current register contents. This commit fixes a couple of bad
calculations. This will fix the return value of copy_from_user and
copy_to_user in the faulting case. The behaviour of memcpy stays unchanged.

Fixes: 34060b8fffa7 ("arch/sparc: Add accurate exception reporting in M7memcpy")
Tested-by: John Paul Adrian Glaubitz &lt;glaubitz@physik.fu-berlin.de&gt; # on Oracle SPARC S7
Tested-by: Tony Rodriguez &lt;unixpro1970@gmail.com&gt; # S7, see https://lore.kernel.org/r/98564e2e68df2dda0e00c67a75c7f7dfedb33c7e.camel@physik.fu-berlin.de
Signed-off-by: Michael Karcher &lt;kernel@mkarcher.dialup.fu-berlin.de&gt;
Reviewed-by: Andreas Larsson &lt;andreas@gaisler.com&gt;
Link: https://lore.kernel.org/r/20250905-memcpy_series-v4-5-1ca72dda195b@mkarcher.dialup.fu-berlin.de
Signed-off-by: Andreas Larsson &lt;andreas@gaisler.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>sparc: fix accurate exception reporting in copy_to_user for Niagara 4</title>
<updated>2025-10-15T10:00:14+00:00</updated>
<author>
<name>Michael Karcher</name>
<email>kernel@mkarcher.dialup.fu-berlin.de</email>
</author>
<published>2025-09-04T22:03:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5d8857c43bf1648df8cff6d3b8ce388396a4a8e0'/>
<id>urn:sha1:5d8857c43bf1648df8cff6d3b8ce388396a4a8e0</id>
<content type='text'>
[ Upstream commit 5a746c1a2c7980de6c888b6373299f751ad7790b ]

The referenced commit introduced exception handlers on user-space memory
references in copy_from_user and copy_to_user. These handlers return from
the respective function and calculate the remaining bytes left to copy
using the current register contents. This commit fixes a bad calculation.
This will fix the return value of copy_to_user in a specific faulting case.
The behaviour of memcpy stays unchanged.

Fixes: 957077048009 ("sparc64: Convert NG4copy_{from,to}_user to accurate exception reporting.")
Tested-by: John Paul Adrian Glaubitz &lt;glaubitz@physik.fu-berlin.de&gt; # on Oracle SPARC T4-1
Signed-off-by: Michael Karcher &lt;kernel@mkarcher.dialup.fu-berlin.de&gt;
Reviewed-by: Andreas Larsson &lt;andreas@gaisler.com&gt;
Link: https://lore.kernel.org/r/20250905-memcpy_series-v4-4-1ca72dda195b@mkarcher.dialup.fu-berlin.de
Signed-off-by: Andreas Larsson &lt;andreas@gaisler.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>sparc: fix accurate exception reporting in copy_{from_to}_user for Niagara</title>
<updated>2025-10-15T10:00:14+00:00</updated>
<author>
<name>Michael Karcher</name>
<email>kernel@mkarcher.dialup.fu-berlin.de</email>
</author>
<published>2025-09-04T22:03:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a90ce516a73dbe087f9bf3dbf311301a58d125c6'/>
<id>urn:sha1:a90ce516a73dbe087f9bf3dbf311301a58d125c6</id>
<content type='text'>
[ Upstream commit 0b67c8fc10b13a9090340c5f8a37d308f4e1571c ]

The referenced commit introduced exception handlers on user-space memory
references in copy_from_user and copy_to_user. These handlers return from
the respective function and calculate the remaining bytes left to copy
using the current register contents. This commit fixes a couple of bad
calculations and a broken epilogue in the exception handlers. This will
prevent crashes and ensure correct return values of copy_from_user and
copy_to_user in the faulting case. The behaviour of memcpy stays unchanged.

Fixes: 7ae3aaf53f16 ("sparc64: Convert NGcopy_{from,to}_user to accurate exception reporting.")
Tested-by: John Paul Adrian Glaubitz &lt;glaubitz@physik.fu-berlin.de&gt; # on SPARC T4 with modified kernel to use Niagara 1 code
Tested-by: Magnus Lindholm &lt;linmag7@gmail.com&gt; # on Sun Fire T2000
Signed-off-by: Michael Karcher &lt;kernel@mkarcher.dialup.fu-berlin.de&gt;
Tested-by: Ethan Hawke &lt;ehawk@ember.systems&gt; # on Sun Fire T2000
Tested-by: Ken Link &lt;iissmart@numberzero.org&gt; # on Sun Fire T1000
Reviewed-by: Andreas Larsson &lt;andreas@gaisler.com&gt;
Link: https://lore.kernel.org/r/20250905-memcpy_series-v4-3-1ca72dda195b@mkarcher.dialup.fu-berlin.de
Signed-off-by: Andreas Larsson &lt;andreas@gaisler.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC III</title>
<updated>2025-10-15T10:00:14+00:00</updated>
<author>
<name>Michael Karcher</name>
<email>kernel@mkarcher.dialup.fu-berlin.de</email>
</author>
<published>2025-09-04T22:03:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ef9c94d7110e90260c06868cf1dcf899b9f25ee'/>
<id>urn:sha1:5ef9c94d7110e90260c06868cf1dcf899b9f25ee</id>
<content type='text'>
[ Upstream commit 47b49c06eb62504075f0f2e2227aee2e2c2a58b3 ]

Anthony Yznaga tracked down that a BUG_ON in ext4 code with large folios
enabled resulted from copy_from_user() returning impossibly large values
greater than the size to be copied. This lead to __copy_from_iter()
returning impossible values instead of the actual number of bytes it was
able to copy.

The BUG_ON has been reported in
https://lore.kernel.org/r/b14f55642207e63e907965e209f6323a0df6dcee.camel@physik.fu-berlin.de

The referenced commit introduced exception handlers on user-space memory
references in copy_from_user and copy_to_user. These handlers return from
the respective function and calculate the remaining bytes left to copy
using the current register contents. The exception handlers expect that
%o2 has already been masked during the bulk copy loop, but the masking was
performed after that loop. This will fix the return value of copy_from_user
and copy_to_user in the faulting case. The behaviour of memcpy stays
unchanged.

Fixes: ee841d0aff64 ("sparc64: Convert U3copy_{from,to}_user to accurate exception reporting.")
Tested-by: John Paul Adrian Glaubitz &lt;glaubitz@physik.fu-berlin.de&gt; # on Sun Netra 240
Reviewed-by: Anthony Yznaga &lt;anthony.yznaga@oracle.com&gt;
Tested-by: René Rebe &lt;rene@exactcode.com&gt; # on UltraSparc III+ and UltraSparc IIIi
Signed-off-by: Michael Karcher &lt;kernel@mkarcher.dialup.fu-berlin.de&gt;
Reviewed-by: Andreas Larsson &lt;andreas@gaisler.com&gt;
Link: https://lore.kernel.org/r/20250905-memcpy_series-v4-2-1ca72dda195b@mkarcher.dialup.fu-berlin.de
Signed-off-by: Andreas Larsson &lt;andreas@gaisler.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC</title>
<updated>2025-10-15T10:00:14+00:00</updated>
<author>
<name>Michael Karcher</name>
<email>kernel@mkarcher.dialup.fu-berlin.de</email>
</author>
<published>2025-09-04T22:03:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7de3a75bbc8465d816336c74d50109e73501efab'/>
<id>urn:sha1:7de3a75bbc8465d816336c74d50109e73501efab</id>
<content type='text'>
[ Upstream commit 4fba1713001195e59cfc001ff1f2837dab877efb ]

The referenced commit introduced exception handlers on user-space memory
references in copy_from_user and copy_to_user. These handlers return from
the respective function and calculate the remaining bytes left to copy
using the current register contents. This commit fixes a couple of bad
calculations. This will fix the return value of copy_from_user and
copy_to_user in the faulting case. The behaviour of memcpy stays unchanged.

Fixes: cb736fdbb208 ("sparc64: Convert U1copy_{from,to}_user to accurate exception reporting.")
Tested-by: John Paul Adrian Glaubitz &lt;glaubitz@physik.fu-berlin.de&gt; # on QEMU 10.0.3
Tested-by: René Rebe &lt;rene@exactcode.com&gt; # on Ultra 5 UltraSparc IIi
Tested-by: Jonathan 'theJPster' Pallant &lt;kernel@thejpster.org.uk&gt; # on Sun Netra T1
Signed-off-by: Michael Karcher &lt;kernel@mkarcher.dialup.fu-berlin.de&gt;
Reviewed-by: Andreas Larsson &lt;andreas@gaisler.com&gt;
Link: https://lore.kernel.org/r/20250905-memcpy_series-v4-1-1ca72dda195b@mkarcher.dialup.fu-berlin.de
Signed-off-by: Andreas Larsson &lt;andreas@gaisler.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>sparc32: add __cmpxchg_u{8,16}() and teach __cmpxchg() to handle those sizes</title>
<updated>2024-04-10T05:06:00+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2024-04-02T02:17:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dbc93fdcdc0d4df7abad10aac14326a4a9975997'/>
<id>urn:sha1:dbc93fdcdc0d4df7abad10aac14326a4a9975997</id>
<content type='text'>
trivial now

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>sparc32: unify __cmpxchg_u{32,64}</title>
<updated>2024-04-10T05:06:00+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2024-04-02T02:12:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d7b52b48f006ea3dd2e682097a91eeda9dfb3df9'/>
<id>urn:sha1:d7b52b48f006ea3dd2e682097a91eeda9dfb3df9</id>
<content type='text'>
Add a macro that expands to one of those when given u32 or u64
as an argument - atomic32.c has a lot of similar stuff already.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>sparc32: make the first argument of __cmpxchg_u64() volatile u64 *</title>
<updated>2024-04-10T05:06:00+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2024-04-02T02:07:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b7e2a6389e146325227d90eb3ee47bf11647cde6'/>
<id>urn:sha1:b7e2a6389e146325227d90eb3ee47bf11647cde6</id>
<content type='text'>
... to match all cmpxchg variants.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>sparc32: make __cmpxchg_u32() return u32</title>
<updated>2024-04-10T05:06:00+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2024-04-02T01:58:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2f528020a29021a9e5da1b85488993e8d9808a38'/>
<id>urn:sha1:2f528020a29021a9e5da1b85488993e8d9808a38</id>
<content type='text'>
Conversion between u32 and unsigned long is tautological there,
and the only use of return value is to return it from
__cmpxchg() (which return unsigned long).

Get rid of explicit casts in __cmpxchg_u32() call, while we are
at it - normal conversions for arguments will do just fine.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>sparc32: Use generic cmpdi2/ucmpdi2 variants</title>
<updated>2024-03-08T20:20:23+00:00</updated>
<author>
<name>Sam Ravnborg</name>
<email>sam@ravnborg.org</email>
</author>
<published>2024-02-24T17:42:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=802a8874a3889a4a0d218d4f73e5855c96d5b8a8'/>
<id>urn:sha1:802a8874a3889a4a0d218d4f73e5855c96d5b8a8</id>
<content type='text'>
Use the generic variants - the implementation is the same.
As a nice side-effect fix the following warnings:

cmpdi2.c: warning: no previous prototype for '__cmpdi2' [-Wmissing-prototypes]
ucmpdi2.c: warning: no previous prototype for '__ucmpdi2' [-Wmissing-prototypes]

Signed-off-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Fixes: 0fcb70851fbf ("Makefile.extrawarn: turn on missing-prototypes globally")
Reviewed-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Tested-by: Randy Dunlap &lt;rdunlap@infradead.org&gt; # build-tested
Reviewed-by: Maciej W. Rozycki &lt;macro@orcam.me.uk&gt;
Tested-by: Maciej W. Rozycki &lt;macro@orcam.me.uk&gt; # build-tested
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Andreas Larsson &lt;andreas@gaisler.com&gt;
Reviewed-by: Andreas Larsson &lt;andreas@gaisler.com&gt;
Tested-by: Andreas Larsson &lt;andreas@gaisler.com&gt;
Signed-off-by: Andreas Larsson &lt;andreas@gaisler.com&gt;
Link: https://lore.kernel.org/r/20240224-sam-fix-sparc32-all-builds-v2-1-1f186603c5c4@ravnborg.org
</content>
</entry>
</feed>
