From: Andreas Larsson <andreas@gaisler.com>
To: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org,
"John Paul Adrian Glaubitz" <glaubitz@physik.fu-berlin.de>,
"Anthony Yznaga" <anthony.yznaga@oracle.com>,
"René Rebe" <rene@exactcode.com>,
"Jonathan 'theJPster' Pallant" <kernel@thejpster.org.uk>,
"Magnus Lindholm" <linmag7@gmail.com>,
"Tony Rodriguez" <unixpro1970@gmail.com>
Subject: Re: [PATCH v4 0/5] Fix accurate exception reporting in SPARC assembly
Date: Fri, 19 Sep 2025 20:03:50 +0200 [thread overview]
Message-ID: <8d32507a-dd01-4785-946d-00ad28b1fd58@gaisler.com> (raw)
In-Reply-To: <20250905-memcpy_series-v4-0-1ca72dda195b@mkarcher.dialup.fu-berlin.de>
On 2025-09-05 00:03, Michael Karcher wrote:
> In 2018, David Miller implemented accurate exception reporting in
> copy_from_user and copy_to_user by handling exceptions on each load
> or store instruction that accesses userspace memory and calculating
> the remaining bytes from the processor context. As issues with
> transparent huge page support and folio support in ext4 were due
> to a bogus return value from copy_from_user, I wrote a comprehensive
> testsuite for the generic variant, and the machine-specific variants
> for UltraSPARC I/II, UltraSPARC III, Niagara, Niagara 2/3,
> Niagara 4 and M7, see
>
> https://github.com/karcherm/sparc-cfu-bug-reproducer
>
> despite the name of the project, it does not only test copy_from_user,
> but also copy_to_user, and it also contains fixes to a very small amount
> of exception handler references that were calculating the result in
> a wrong way.
>
> For UltraSPARC III, I chose to adjust the memcpy code itself instead of
> adding complexity to multiple exception handlers. That fix has already
> been tested to fix stability issues observed by Adrian Glaubitz which
> kicked off the investigation. On all other architectures, the changes
> are just to the exception handlers.
>
> Kind regards,
> Michael Karcher
>
> Signed-off-by: Michael Karcher <kernel@mkarcher.dialup.fu-berlin.de>
> ---
> Changes in v4:
> - Add further credit for running tests on machines with this patch applied
> - Link to v3: https://lore.kernel.org/r/20250904-memcpy_series-v3-0-906655a5a7ad@mkarcher.dialup.fu-berlin.de
>
> Changes in v3:
> - Fix bad formatting in commit messages (missing line wrap,
> extra empty line after Fixes:)
> - Consistently add hardware to Tested-By lines
> - Link to v2: https://lore.kernel.org/r/20250904-memcpy_series-v2-0-9806dd1784e7@mkarcher.dialup.fu-berlin.de
>
> Changes in v2:
> - More verbose description on how these issues were found
> - Add M7 change, previously separate in
> https://lore.kernel.org/r/20250828121844.2250-1-kernel@mkarcher.dialup.fu-berlin.de
> - Link to v1: https://lore.kernel.org/r/20250826160312.2070-1-kernel@mkarcher.dialup.fu-berlin.de
>
> ---
> Michael Karcher (5):
> sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC
> sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC III
> sparc: fix accurate exception reporting in copy_{from_to}_user for Niagara
> sparc: fix accurate exception reporting in copy_to_user for Niagara 4
> sparc: fix accurate exception reporting in copy_{from,to}_user for M7
>
> arch/sparc/lib/M7memcpy.S | 20 ++++++++++----------
> arch/sparc/lib/Memcpy_utils.S | 9 +++++++++
> arch/sparc/lib/NG4memcpy.S | 2 +-
> arch/sparc/lib/NGmemcpy.S | 29 ++++++++++++++++++-----------
> arch/sparc/lib/U1memcpy.S | 19 ++++++++++---------
> arch/sparc/lib/U3memcpy.S | 2 +-
> 6 files changed, 49 insertions(+), 32 deletions(-)
> ---
> base-commit: b320789d6883cc00ac78ce83bccbfe7ed58afcf0
> change-id: 20250902-memcpy_series-b3bdd5542ca7
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Picking this up to my for-next.
Thanks,
Andreas
prev parent reply other threads:[~2025-09-19 18:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 22:03 Michael Karcher
2025-09-04 22:03 ` [PATCH v4 1/5] sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC Michael Karcher
2025-09-04 22:03 ` [PATCH v4 2/5] sparc: fix accurate exception reporting in copy_{from_to}_user for UltraSPARC III Michael Karcher
2025-09-07 17:02 ` John Paul Adrian Glaubitz
2025-09-07 17:32 ` René Rebe
2025-09-07 17:57 ` John Paul Adrian Glaubitz
2025-09-07 17:49 ` John Paul Adrian Glaubitz
2025-09-07 18:33 ` John Paul Adrian Glaubitz
2025-09-07 21:31 ` John Paul Adrian Glaubitz
2025-09-08 6:30 ` John Paul Adrian Glaubitz
2025-09-08 6:47 ` John Paul Adrian Glaubitz
2025-09-08 6:53 ` John Paul Adrian Glaubitz
2025-09-08 22:47 ` Anthony Yznaga
2025-09-09 5:54 ` John Paul Adrian Glaubitz
2025-09-04 22:03 ` [PATCH v4 3/5] sparc: fix accurate exception reporting in copy_{from_to}_user for Niagara Michael Karcher
2025-09-04 22:03 ` [PATCH v4 4/5] sparc: fix accurate exception reporting in copy_to_user for Niagara 4 Michael Karcher
2025-09-04 22:03 ` [PATCH v4 5/5] sparc: fix accurate exception reporting in copy_{from,to}_user for M7 Michael Karcher
2025-09-19 18:03 ` Andreas Larsson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d32507a-dd01-4785-946d-00ad28b1fd58@gaisler.com \
--to=andreas@gaisler.com \
--cc=anthony.yznaga@oracle.com \
--cc=glaubitz@physik.fu-berlin.de \
--cc=kernel@mkarcher.dialup.fu-berlin.de \
--cc=kernel@thejpster.org.uk \
--cc=linmag7@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rene@exactcode.com \
--cc=sparclinux@vger.kernel.org \
--cc=unixpro1970@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®