diff options
author | Oliver Upton <oliver.upton@linux.dev> | 2023-09-20 08:01:33 +0000 |
---|---|---|
committer | Oliver Upton <oliver.upton@linux.dev> | 2023-09-22 17:55:05 +0000 |
commit | 909b583f81b5bb5a398d4580543f59b908a86ccc (patch) | |
tree | eb57b723c2583c80f2f2911793f935591144e57f /lib/test_fortify/write_overflow-strlcpy.c | |
parent | ec1c3b9ff16082f880b304be40992568f4eee6a7 (diff) |
KVM: arm64: Avoid soft lockups due to I-cache maintenance
Gavin reports of soft lockups on his Ampere Altra Max machine when
backing KVM guests with hugetlb pages. Upon further investigation, it
was found that the system is unable to keep up with parallel I-cache
invalidations done by KVM's stage-2 fault handler.
This is ultimately an implementation problem. I-cache maintenance
instructions are available at EL0, so nothing stops a malicious
userspace from hammering a system with CMOs and cause it to fall over.
"Fixing" this problem in KVM is nothing more than slapping a bandage
over a much deeper problem.
Anyway, the kernel already has a heuristic for limiting TLB
invalidations to avoid soft lockups. Reuse that logic to limit I-cache
CMOs done by KVM to map executable pages on systems without FEAT_DIC.
While at it, restructure __invalidate_icache_guest_page() to improve
readability and squeeze our new condition into the existing branching
structure.
Link: https://lore.kernel.org/kvmarm/20230904072826.1468907-1-gshan@redhat.com/
Reviewed-by: Gavin Shan <gshan@redhat.com>
Tested-by: Gavin Shan <gshan@redhat.com>
Link: https://lore.kernel.org/r/20230920080133.944717-3-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'lib/test_fortify/write_overflow-strlcpy.c')
0 files changed, 0 insertions, 0 deletions