]> www.infradead.org Git - users/willy/pagecache.git/commit
LoongArch: Add debugfs entries to switch SFB/TSO state
authorHuacai Chen <chenhuacai@loongson.cn>
Sun, 26 Jan 2025 13:49:59 +0000 (21:49 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Sun, 26 Jan 2025 13:49:59 +0000 (21:49 +0800)
commit04816c1507b46baccd17a4bc948440b3634d5d13
treeac5d58a45cfd27cd6f7abab990a5a66ace19e484
parent26c0a2d93af55d30a46d5f45d3e9c42cde730168
LoongArch: Add debugfs entries to switch SFB/TSO state

We need to switch SFB (Store Fill Buffer) and TSO (Total Store Order)
state at runtime to debug memory management and KVM virtualization, so
add two debugfs entries "sfb_state" and "tso_state" under the directory
/sys/kernel/debug/loongarch.

Query SFB:
cat /sys/kernel/debug/loongarch/sfb_state

Enable SFB:
echo 1 > /sys/kernel/debug/loongarch/sfb_state

Disable SFB:
echo 0 > /sys/kernel/debug/loongarch/sfb_state

Query TSO:
cat /sys/kernel/debug/loongarch/tso_state

Switch TSO:
echo [TSO] > /sys/kernel/debug/loongarch/tso_state

Available [TSO] states:
0 (No Load No Store)    1 (All Load No Store)   3 (Same Load No Store)
4 (No Load All Store)   5 (All Load All Store)  7 (Same Load All Store)

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/include/asm/loongarch.h
arch/loongarch/kernel/Makefile
arch/loongarch/kernel/kdebugfs.c [new file with mode: 0644]
arch/loongarch/kernel/unaligned.c