linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/12] kasan: optimizations and fixes for HW_TAGS
@ 2021-02-05 15:39 Andrey Konovalov
  2021-02-05 15:39 ` [PATCH v2 01/12] kasan, mm: don't save alloc stacks twice Andrey Konovalov
                   ` (13 more replies)
  0 siblings, 14 replies; 17+ messages in thread
From: Andrey Konovalov @ 2021-02-05 15:39 UTC (permalink / raw)
  To: Andrew Morton, Catalin Marinas, Vincenzo Frascino, Dmitry Vyukov,
	Alexander Potapenko, Marco Elver
  Cc: Will Deacon, Andrey Ryabinin, Peter Collingbourne,
	Evgenii Stepanov, Branislav Rankov, Kevin Brodsky, kasan-dev,
	linux-arm-kernel, linux-mm, linux-kernel, Andrey Konovalov

This patchset goes on top of:

1. Vincenzo's async support patches [1], and
2. "kasan: untag addresses for KFENCE" fix [2] (already in mm).

[1] https://lore.kernel.org/linux-arm-kernel/20210130165225.54047-1-vincenzo.frascino@arm.com/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=akpm&id=dec4728fab910da0c86cf9a97e980f4244ebae9f

This patchset makes the HW_TAGS mode more efficient, mostly by reworking
poisoning approaches and simplifying/inlining some internal helpers.

With this change, the overhead of HW_TAGS annotations excluding setting
and checking memory tags is ~3%. The performance impact caused by tags
will be unknown until we have hardware that supports MTE.

As a side-effect, this patchset speeds up generic KASAN by ~15%.

Andrey Konovalov (12):
  kasan, mm: don't save alloc stacks twice
  kasan, mm: optimize kmalloc poisoning
  kasan: optimize large kmalloc poisoning
  kasan: clean up setting free info in kasan_slab_free
  kasan: unify large kfree checks
  kasan: rework krealloc tests
  kasan, mm: fail krealloc on freed objects
  kasan, mm: optimize krealloc poisoning
  kasan: ensure poisoning size alignment
  arm64: kasan: simplify and inline MTE functions
  kasan: inline HW_TAGS helper functions
  arm64: kasan: export MTE symbols for KASAN tests

 arch/arm64/include/asm/cache.h     |   1 -
 arch/arm64/include/asm/kasan.h     |   1 +
 arch/arm64/include/asm/mte-def.h   |   2 +
 arch/arm64/include/asm/mte-kasan.h |  65 ++++++++--
 arch/arm64/include/asm/mte.h       |   2 -
 arch/arm64/kernel/mte.c            |  48 +-------
 arch/arm64/lib/mte.S               |  16 ---
 include/linux/kasan.h              |  25 ++--
 lib/test_kasan.c                   | 111 +++++++++++++++--
 mm/kasan/common.c                  | 187 ++++++++++++++++++++---------
 mm/kasan/kasan.h                   |  72 +++++++++--
 mm/kasan/shadow.c                  |  53 ++++----
 mm/slab_common.c                   |  18 ++-
 mm/slub.c                          |   3 +-
 14 files changed, 418 insertions(+), 186 deletions(-)

-- 
2.30.0.365.g02bc693789-goog


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-02-09 15:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-05 15:39 [PATCH v2 00/12] kasan: optimizations and fixes for HW_TAGS Andrey Konovalov
2021-02-05 15:39 ` [PATCH v2 01/12] kasan, mm: don't save alloc stacks twice Andrey Konovalov
2021-02-05 15:39 ` [PATCH v2 02/12] kasan, mm: optimize kmalloc poisoning Andrey Konovalov
2021-02-05 15:39 ` [PATCH v2 03/12] kasan: optimize large " Andrey Konovalov
2021-02-05 15:39 ` [PATCH v2 04/12] kasan: clean up setting free info in kasan_slab_free Andrey Konovalov
2021-02-05 15:39 ` [PATCH v2 05/12] kasan: unify large kfree checks Andrey Konovalov
2021-02-05 15:39 ` [PATCH v2 06/12] kasan: rework krealloc tests Andrey Konovalov
2021-02-05 15:39 ` [PATCH v2 07/12] kasan, mm: fail krealloc on freed objects Andrey Konovalov
2021-02-05 15:39 ` [PATCH v2 08/12] kasan, mm: optimize krealloc poisoning Andrey Konovalov
2021-02-05 15:39 ` [PATCH v2 09/12] kasan: ensure poisoning size alignment Andrey Konovalov
2021-02-05 15:39 ` [PATCH v2 10/12] arm64: kasan: simplify and inline MTE functions Andrey Konovalov
2021-02-05 15:39 ` [PATCH v2 11/12] kasan: inline HW_TAGS helper functions Andrey Konovalov
2021-02-05 15:39 ` [PATCH v2 12/12] arm64: kasan: export MTE symbols for KASAN tests Andrey Konovalov
2021-02-08 17:42   ` Christoph Hellwig
2021-02-09 15:18     ` Andrey Konovalov
2021-02-05 16:25 ` [PATCH v2 00/12] kasan: optimizations and fixes for HW_TAGS Andrey Konovalov
2021-02-05 16:53 ` Andrey Konovalov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).