blob: 2dc5f9e18039b3a01e08857455cc2c59e79d6af6 [file] [log] [blame]
Steve Capper6bd1d0b2019-08-07 16:55:15 +01001#!/bin/sh
2
3# Print out the KASAN_SHADOW_OFFSETS required to place the KASAN SHADOW
Ard Biesheuvelf4693c22020-10-08 17:36:00 +02004# start address at the top of the linear region
Steve Capper6bd1d0b2019-08-07 16:55:15 +01005
6print_kasan_offset () {
7 printf "%02d\t" $1
8 printf "0x%08x00000000\n" $(( (0xffffffff & (-1 << ($1 - 1 - 32))) \
Steve Capper6bd1d0b2019-08-07 16:55:15 +01009 - (1 << (64 - 32 - $2)) ))
10}
11
12echo KASAN_SHADOW_SCALE_SHIFT = 3
13printf "VABITS\tKASAN_SHADOW_OFFSET\n"
14print_kasan_offset 48 3
15print_kasan_offset 47 3
16print_kasan_offset 42 3
17print_kasan_offset 39 3
18print_kasan_offset 36 3
19echo
20echo KASAN_SHADOW_SCALE_SHIFT = 4
21printf "VABITS\tKASAN_SHADOW_OFFSET\n"
22print_kasan_offset 48 4
23print_kasan_offset 47 4
24print_kasan_offset 42 4
25print_kasan_offset 39 4
26print_kasan_offset 36 4