mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: linux-arm-kernel@lists.infradead.org,
	Al Viro <viro@zeniv.linux.org.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>
Cc: linux-kernel@vger.kernel.org, mark.rutland@arm.com, robin.murphy@arm.com
Subject: [PATCH 0/4] usercopy: generic tests + arm64 fixes
Date: Tue, 14 Mar 2023 11:50:26 +0000	[thread overview]
Message-ID: <20230314115030.347976-1-mark.rutland@arm.com> (raw)

This series adds tests for the usercopy functions, and fixes some
deficiencies on arm64.

This is a follow-up to Robin's earlier usercopy refresh [1], where we
found some issues and Will had asked for tests. In the process of
writing tests, I discovered arm64 had some latent issues, and running
the tests on other architectures, it looks like most have issues...

Al, I'd appreciate if you could take a look at the first couple of
patches and check if I've got the intended semantics correct. I think
I've got that right for __raw_copy_{to,from}_user(), but I'm not sure
whether clear_user() is expected to behave the same, and I may have
missed something or assumed something overly strong.

Catalin, Will, the last two patches fix arm64's implementation of
__raw_copy_to_user() and clear_user(), per the understanding above. I
believe these are correct (as they've passed exhaustive testing), and
benchmarking shows they're at least as good as the current
implementations. 

Thanks,
Mark.

[1] https://lore.kernel.org/linux-arm-kernel/cover.1664363162.git.robin.murphy@arm.com/

Mark Rutland (4):
  lib: test copy_{to,from}_user()
  lib: test clear_user()
  arm64: fix __raw_copy_to_user semantics
  arm64: fix clear_user() semantics

 arch/arm64/lib/clear_user.S   | 195 ++++++++++---
 arch/arm64/lib/copy_to_user.S | 203 ++++++++++---
 lib/Kconfig.debug             |   9 +
 lib/Makefile                  |   1 +
 lib/usercopy_kunit.c          | 520 ++++++++++++++++++++++++++++++++++
 5 files changed, 848 insertions(+), 80 deletions(-)
 create mode 100644 lib/usercopy_kunit.c

-- 
2.30.2


             reply	other threads:[~2023-03-14 11:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 11:50 Mark Rutland [this message]
2023-03-14 11:50 ` [PATCH 1/4] lib: test copy_{to,from}_user() Mark Rutland
2023-03-14 11:50 ` [PATCH 2/4] lib: test clear_user() Mark Rutland
2023-03-14 11:50 ` [PATCH 3/4] arm64: fix __raw_copy_to_user semantics Mark Rutland
2023-03-14 11:50 ` [PATCH 4/4] arm64: fix clear_user() semantics Mark Rutland

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=20230314115030.347976-1-mark.rutland@arm.com \
    --to=mark.rutland@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=will@kernel.org \
    /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®