-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
CONFIG on LINUX:
CONFIG_DM_CRYPT=y
CONFIG_TRUSTED_KEYS=y
CONFIG_TRUSTED_KEYS_TEE=y
CONFIG_IMX_SEC_ENCLAVE=n
CONFIG_IMX_ELE_TRNG=n
CONFIG_PREEMPT_RT=y
CONFIG_BLK_DEV_LOOP=y
Following steps ran on Linux:
a. $:> mkdir -p /data/crypt
b.
$:>KEYNAME=dm_trust_plainkey
$:>keyctl pipe $KEY > /data/$KEYNAME.blob
$:>keyctl list @s
c.
$:>DEV=/dev/loop0
$:>ALGO="capi:cbc-aes-tee-plain"
$:>dd if=/dev/zero of=/data/crypt/encrypted.img bs=1M count=512 && losetup /dev/loop0 /data/crypt/encrypted.img
d.
$:>TABLE="0 $BLOCKS crypt $ALGO :32:trusted:$KEYNAME 0 $DEV 0 1 sector_size:512"
$:>dmsetup -v create encrypted --table "$TABLE"
e.
$:>mkfs.ext4 /dev/mapper/encrypted
$:>mkdir -p /data/mnt/encrypted
$:>mount -t ext4 /dev/mapper/encrypted /data/mnt/encrypted
f.
$:>fio --filename=/data/mnt/encrypted/fio.bin --size=128MB --rw=rw --bs=8k --ioengine=sync --iodepth=1 --runtime=120 --numjobs=1 --time_based --group_reporting --name=throughput-test-job --eta-newline=1
root@imx93evk:~#
Below is running commands,
root@imx93evk:~# insmod tee_crypto.ko
root@imx93evk:~# ./dm-crypt-init.sh
root@imx93evk:~# fio --filename=/data/mnt/encrypted/fio.bin --size=16MB --rw=rw --bs=512 --ioengine=sync --iodepth=1 --runtime=120
--numjobs=1 --time_based --group_reporting --name=throughput-test-job --eta-newline=1
throughput-test-job: (g=0): rw=rw, bs=(R) 512B-512B, (W) 512B-512B, (T) 512B-512B, ioengine=sync, iodepth=1
fio-3.36-117-gb2403
Starting 1 process
Jobs: 1 (f=1): [M(1)][2.5%][r=6675KiB/s,w=6787KiB/s][r=13.4k,w=13.6k IOPS][eta 01m:57s]
Jobs: 1 (f=1): [M(1)][4.1%][r=7617KiB/s,w=7500KiB/s][r=15.2k,w=15.0k IOPS][eta 01m:56s]
Jobs: 1 (f=1): [M(1)][5.8%][r=8540KiB/s,w=8477KiB/s][r=17.1k,w=17.0k IOPS][eta 01m:54s]
Jobs: 1 (f=1): [M(1)][7.4%][r=6339KiB/s,w=6396KiB/s][r=12.7k,w=12.8k IOPS][eta 01m:52s]
Jobs: 1 (f=1): [M(1)][9.1%][r=6710KiB/s,w=6790KiB/s][r=13.4k,w=13.6k IOPS][eta 01m:50s]
Jobs: 1 (f=1): [M(1)][9.9%][r=24.2MiB/s,w=24.3MiB/s][r=49.6k,w=49.8k IOPS][eta 01m:49s]
Jobs: 1 (f=1): [M(1)][10.7%][r=19.9MiB/s,w=19.9MiB/s][r=40.8k,w=40.8k IOPS][eta 01m:48s]
Jobs: 1 (f=1): [M(1)][12.4%][r=6286KiB/s,w=6202KiB/s][r=12.6k,w=12.4k IOPS][eta 01m:46s]
Jobs: 1 (f=1): [M(1)][13.2%][r=6531KiB/s,w=6511KiB/s][r=13.1k,w=13.0k IOPS][eta 01m:45s]
Jobs: 1 (f=1): [M(1)][14.9%][r=7685KiB/s,w=7813KiB/s][r=15.4k,w=15.6k IOPS][eta 01m:43s]
Jobs: 1 (f=1): [M(1)][16.5%][r=7179KiB/s,w=7212KiB/s][r=14.4k,w=14.4k IOPS][eta 01m:41s]
Jobs: 1 (f=1): [M(1)][17.4%][r=6685KiB/s,w=6616KiB/s][r=13.4k,w=13.2k IOPS][eta 01m:40s]
Jobs: 1 (f=1): [M(1)][19.0%][r=9592KiB/s,w=9614KiB/s][r=19.2k,w=19.2k IOPS][eta 01m:38s]
Segmentation fault (core dumped)947KiB/s,w=9007KiB/s][r=17.9k,w=18.0k IOPS][eta 01m:36s]
root@imx93evk:~#
(gdb) run --filename=/data/mnt/encrypted/fio.bin --size=128MB --rw=rw --bs=8k --ioengine=sync --iodepth=1 --runtime=120 --numjobs=1 --time_based --group_reporting --name=throughput-test-job --eta-newline=1
(gdb) bt
#0 __memchr_generic () at ../sysdeps/aarch64/multiarch/../memchr.S:64
#1 0x0000fffff7d2cd38 in __GI__IO_getline_info (fp=fp@entry=0xffffe8000b70,
buf=buf@entry=0xffffeed92418 "\214\203\255\252\252\252", n=n@entry=255, delim=delim@entry=10,
extract_delim=extract_delim@entry=1, eof=eof@entry=0x0) at iogetline.c:85
#2 0x0000fffff7d2ce5c in __GI__IO_getline (fp=fp@entry=0xffffe8000b70, buf=buf@entry=0xffffeed92418 "\214\203\255\252\252\252",
n=n@entry=255, delim=delim@entry=10, extract_delim=extract_delim@entry=1) at iogetline.c:34
#3 0x0000fffff7d2b898 in _IO_fgets (buf=buf@entry=0xffffeed92418 "\214\203\255\252\252\252", n=n@entry=256,
fp=fp@entry=0xffffe8000b70) at iofgets.c:53
#4 0x0000aaaaaab1b200 in fgets (__stream=0xffffe8000b70, __n=256, __s=0xffffeed92418 "\214\203\255\252\252\252")
at /usr/include/bits/stdio2.h:200
#5 get_io_ticks (du=du@entry=0xfffff6ca5570, dus=dus@entry=0xffffeed92570) at diskutil.c:59
#6 0x0000aaaaaab1beec in update_io_tick_disk (du=0xfffff6ca5570) at diskutil.c:104
#7 update_io_ticks () at diskutil.c:141
#8 0x0000aaaaaab0d7c8 in eval_timer (msec_to_next_event=<synthetic pointer>, now=0xffffeed926c0, it=0xffffeed926f0)
at helper_thread.c:270
#9 helper_thread_main (data=0xfffff6ca54f0) at helper_thread.c:338
#10 0x0000fffff7d40fc4 in start_thread (arg=0x0) at pthread_create.c:447
#11 0x0000fffff7da31cc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone3.S:76
(gdb) l
59 in ../sysdeps/aarch64/multiarch/../memchr.S
Other observations:
- Issue is not coming with CONFIG_PREEMPT_RT=n
- FIO repo used: https://git.kernel.dk/cgit/fio/
- FIO branch (commit): master (7037b83)
- When compile fio with CFLAG+= +g, crash is coming at file:io_u.c:2274.
Please suggest your views. Thanks.