]> asedeno.scripts.mit.edu Git - linux.git/commit
sparc64: Add support for ADI (Application Data Integrity)
authorKhalid Aziz <khalid.aziz@oracle.com>
Fri, 23 Feb 2018 22:46:41 +0000 (15:46 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 18 Mar 2018 14:38:48 +0000 (07:38 -0700)
commit74a04967482faa7144b93dae3b2e913870dd421c
tree387f2497cfd053d99504a00ff8ccce0dd5fbd647
parenta4602b62d9fdea41412ba765bbf32ecfc2b6a94c
sparc64: Add support for ADI (Application Data Integrity)

ADI is a new feature supported on SPARC M7 and newer processors to allow
hardware to catch rogue accesses to memory. ADI is supported for data
fetches only and not instruction fetches. An app can enable ADI on its
data pages, set version tags on them and use versioned addresses to
access the data pages. Upper bits of the address contain the version
tag. On M7 processors, upper four bits (bits 63-60) contain the version
tag. If a rogue app attempts to access ADI enabled data pages, its
access is blocked and processor generates an exception. Please see
Documentation/sparc/adi.txt for further details.

This patch extends mprotect to enable ADI (TSTATE.mcde), enable/disable
MCD (Memory Corruption Detection) on selected memory ranges, enable
TTE.mcd in PTEs, return ADI parameters to userspace and save/restore ADI
version tags on page swap out/in or migration. ADI is not enabled by
default for any task. A task must explicitly enable ADI on a memory
range and set version tag for ADI to be effective for the task.

Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com>
Cc: Khalid Aziz <khalid@gonehiking.org>
Reviewed-by: Anthony Yznaga <anthony.yznaga@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
22 files changed:
Documentation/sparc/adi.txt [new file with mode: 0644]
arch/sparc/include/asm/mman.h
arch/sparc/include/asm/mmu_64.h
arch/sparc/include/asm/mmu_context_64.h
arch/sparc/include/asm/page_64.h
arch/sparc/include/asm/pgtable_64.h
arch/sparc/include/asm/thread_info_64.h
arch/sparc/include/asm/trap_block.h
arch/sparc/include/uapi/asm/mman.h
arch/sparc/kernel/adi_64.c
arch/sparc/kernel/etrap_64.S
arch/sparc/kernel/process_64.c
arch/sparc/kernel/rtrap_64.S
arch/sparc/kernel/setup_64.c
arch/sparc/kernel/urtt_fill.S
arch/sparc/kernel/vmlinux.lds.S
arch/sparc/mm/gup.c
arch/sparc/mm/hugetlbpage.c
arch/sparc/mm/init_64.c
arch/sparc/mm/tsb.c
include/linux/mm.h
mm/ksm.c