Correct aarch64 KPTI dmesg message

As it's seen in unmap_kernel_at_el0 (both the function definition
and its usage in arm64_features[]) from arch/arm64/kernel/cpufeature.c
the kernel reports this string:

CPU features: detected: Kernel page table isolation (KPTI)

or (before commit e0f6429dc1c0 ("arm64: cpufeature: Remove redundant "feature"
in reports")):

CPU features: detected feature: Kernel page table isolation (KPTI)

if KPTI is enabled on the system.

So on let's adjust check_variant3_linux() to make it grep these
strings if executed on an aarch64 platform.

Tested on a Cavium ThunderX2 machine.

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
This commit is contained in:
Stanislav Kholmanskikh 2018-08-29 05:40:52 -07:00
parent dbe1c5b34c
commit bdfcba4dae
1 changed files with 8 additions and 3 deletions

View File

@ -3061,9 +3061,14 @@ check_variant3_linux()
mount_debugfs
_info_nol " * PTI enabled and active: "
if [ "$opt_live" = 1 ]; then
dmesg_grep="Kernel/User page tables isolation: enabled"
dmesg_grep="$dmesg_grep|Kernel page table isolation enabled"
dmesg_grep="$dmesg_grep|x86/pti: Unmapping kernel while in userspace"
if [ "$(uname -m)" = "aarch64" ]; then
dmesg_grep="CPU features: detected: Kernel page table isolation \(KPTI\)"
dmesg_grep="$dmesg_grep|CPU features: detected feature: Kernel page table isolation \(KPTI\)"
else
dmesg_grep="Kernel/User page tables isolation: enabled"
dmesg_grep="$dmesg_grep|Kernel page table isolation enabled"
dmesg_grep="$dmesg_grep|x86/pti: Unmapping kernel while in userspace"
fi
if grep ^flags "$procfs/cpuinfo" | grep -qw pti; then
# vanilla PTI patch sets the 'pti' flag in cpuinfo
_debug "kpti_enabled: found 'pti' flag in $procfs/cpuinfo"