linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] powerpc: KASAN for 64-bit Book3E
@ 2019-02-15  0:04 Daniel Axtens
  2019-02-15  0:04 ` [RFC PATCH 1/5] kasan: do not open-code addr_has_shadow Daniel Axtens
                   ` (6 more replies)
  0 siblings, 7 replies; 27+ messages in thread
From: Daniel Axtens @ 2019-02-15  0:04 UTC (permalink / raw)
  To: aneesh.kumar, christophe.leroy, bsingharora
  Cc: linuxppc-dev, kasan-dev, Daniel Axtens

Building on the work of Christophe, Aneesh and Balbir, I've ported
KASAN to the e6500, a 64-bit Book3E processor which doesn't have a
hashed page table. It applies on top of Christophe's series, v5.

It requires some changes to the KASAN core - please let me know if
these are problematic and we see if an alternative approach is
possible.

The KASAN shadow area is mapped into vmemmap space:
0x8000 0400 0000 0000 to 0x8000 0600 0000 0000.
To do this we require that vmemmap be disabled. (This is the default
in the kernel config that QorIQ provides for the machine in their
SDK anyway - they use flat memory.)

Only outline instrumentation is supported and only KASAN_MINIMAL works.
Only the kernel linear mapping (0xc000...) is checked. The vmalloc and
ioremap areas (also in 0x800...) are all mapped to a zero page. As
with the Book3S hash series, this requires overriding the memory <->
shadow mapping.

Also, as with both previous 64-bit series, early instrumentation is not
supported.

KVM, kexec and xmon have not been tested.

Thanks to those who have done the heavy lifting over the past several years:
 - Christophe's 32 bit series: https://lists.ozlabs.org/pipermail/linuxppc-dev/2019-February/185379.html
 - Aneesh's Book3S hash series: https://lwn.net/Articles/655642/
 - Balbir's Book3S radix series: https://patchwork.ozlabs.org/patch/795211/

While useful if you have an Book3E device, this is mostly intended
as a warm-up exercise for reviving Aneesh's series for book3s hash.
In particular, changes to the kasan core are going to be required
for hash and radix as well.

Regards,
Daniel

Daniel Axtens (5):
  kasan: do not open-code addr_has_shadow
  kasan: allow architectures to manage the memory-to-shadow mapping
  kasan: allow architectures to provide an outline readiness check
  powerpc: move KASAN into its own subdirectory
  powerpc: KASAN for 64bit Book3E

 arch/powerpc/Kconfig                          |  1 +
 arch/powerpc/Makefile                         |  2 +
 arch/powerpc/include/asm/kasan.h              | 77 +++++++++++++++++--
 arch/powerpc/include/asm/ppc_asm.h            |  7 ++
 arch/powerpc/include/asm/string.h             |  7 +-
 arch/powerpc/lib/mem_64.S                     |  6 +-
 arch/powerpc/lib/memcmp_64.S                  |  5 +-
 arch/powerpc/lib/memcpy_64.S                  |  3 +-
 arch/powerpc/lib/string.S                     | 15 ++--
 arch/powerpc/mm/Makefile                      |  4 +-
 arch/powerpc/mm/kasan/Makefile                |  6 ++
 .../{kasan_init.c => kasan/kasan_init_32.c}   |  0
 arch/powerpc/mm/kasan/kasan_init_book3e_64.c  | 53 +++++++++++++
 arch/powerpc/purgatory/Makefile               |  3 +
 arch/powerpc/xmon/Makefile                    |  1 +
 include/linux/kasan.h                         |  6 ++
 mm/kasan/generic.c                            |  5 +-
 mm/kasan/generic_report.c                     |  2 +-
 mm/kasan/kasan.h                              |  6 +-
 mm/kasan/report.c                             |  6 +-
 mm/kasan/tags.c                               |  3 +-
 21 files changed, 188 insertions(+), 30 deletions(-)
 create mode 100644 arch/powerpc/mm/kasan/Makefile
 rename arch/powerpc/mm/{kasan_init.c => kasan/kasan_init_32.c} (100%)
 create mode 100644 arch/powerpc/mm/kasan/kasan_init_book3e_64.c

-- 
2.19.1


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

end of thread, other threads:[~2019-02-26  0:15 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15  0:04 [RFC PATCH 0/5] powerpc: KASAN for 64-bit Book3E Daniel Axtens
2019-02-15  0:04 ` [RFC PATCH 1/5] kasan: do not open-code addr_has_shadow Daniel Axtens
2019-02-15  0:12   ` Andrew Donnellan
2019-02-15  8:21     ` Dmitry Vyukov
2019-02-15  0:04 ` [RFC PATCH 2/5] kasan: allow architectures to manage the memory-to-shadow mapping Daniel Axtens
2019-02-15  6:35   ` Dmitry Vyukov
2019-02-15  0:04 ` [RFC PATCH 3/5] kasan: allow architectures to provide an outline readiness check Daniel Axtens
2019-02-15  8:25   ` Dmitry Vyukov
2019-02-17 12:05   ` christophe leroy
2019-02-18  6:13     ` Daniel Axtens
2019-02-25 14:01       ` Christophe Leroy
2019-02-26  0:14         ` Daniel Axtens
2019-02-15  0:04 ` [RFC PATCH 4/5] powerpc: move KASAN into its own subdirectory Daniel Axtens
2019-02-15  0:24   ` Andrew Donnellan
2019-02-17 16:29   ` christophe leroy
2019-02-18  9:14     ` Michael Ellerman
2019-02-18 12:27       ` Christophe Leroy
2019-02-19  0:44         ` Michael Ellerman
2019-02-15  0:04 ` [RFC PATCH 5/5] powerpc: KASAN for 64bit Book3E Daniel Axtens
2019-02-15  8:28   ` Dmitry Vyukov
2019-02-19  6:37     ` Daniel Axtens
2019-02-17 14:06   ` christophe leroy
2019-02-18 19:26   ` Christophe Leroy
2019-02-19  0:14     ` Daniel Axtens
2019-02-15 16:39 ` [RFC PATCH 0/5] powerpc: KASAN for 64-bit Book3E Christophe Leroy
2019-02-17  6:34 ` Balbir Singh
2019-02-19  6:35   ` Daniel Axtens

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).