linux/tools/testing/selftests/kvm
Paolo Bonzini 771a579c6e Merge branch 'kvm-svm-harden' into HEAD
This fixes three issues in nested SVM:

1) in the shutdown_interception() vmexit handler we call kvm_vcpu_reset().
However, if running nested and L1 doesn't intercept shutdown, the function
resets vcpu->arch.hflags without properly leaving the nested state.
This leaves the vCPU in inconsistent state and later triggers a kernel
panic in SVM code.  The same bug can likely be triggered by sending INIT
via local apic to a vCPU which runs a nested guest.

On VMX we are lucky that the issue can't happen because VMX always
intercepts triple faults, thus triple fault in L2 will always be
redirected to L1.  Plus, handle_triple_fault() doesn't reset the vCPU.
INIT IPI can't happen on VMX either because INIT events are masked while
in VMX mode.

Secondarily, KVM doesn't honour SHUTDOWN intercept bit of L1 on SVM.
A normal hypervisor should always intercept SHUTDOWN, a unit test on
the other hand might want to not do so.

Finally, the guest can trigger a kernel non rate limited printk on SVM
from the guest, which is fixed as well.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-11-17 11:51:09 -05:00
..
aarch64 KVM: selftests: move common startup logic to kvm_util.c 2022-11-16 16:58:56 -08:00
include Merge branch 'kvm-svm-harden' into HEAD 2022-11-17 11:51:09 -05:00
lib Merge branch 'kvm-svm-harden' into HEAD 2022-11-17 11:51:09 -05:00
s390x KVM: selftests: move common startup logic to kvm_util.c 2022-11-16 16:58:56 -08:00
x86_64 Merge branch 'kvm-svm-harden' into HEAD 2022-11-17 11:51:09 -05:00
.gitignore Merge branch 'kvm-svm-harden' into HEAD 2022-11-17 11:51:09 -05:00
access_tracking_perf_test.c KVM: selftests: Rename perf_test_util symbols to memstress 2022-11-16 10:58:32 -08:00
config selftests: kvm: Adding config fragments 2019-08-09 16:52:38 +02:00
demand_paging_test.c KVM: selftests: Rename perf_test_util symbols to memstress 2022-11-16 10:58:32 -08:00
dirty_log_perf_test.c KVM: selftests: Rename perf_test_util symbols to memstress 2022-11-16 10:58:32 -08:00
dirty_log_test.c KVM: selftests: Drop now-unnecessary ucall_uninit() 2022-11-16 16:58:53 -08:00
hardware_disable_test.c KVM: selftests: Move per-VM/per-vCPU nr pages calculation to __vm_create() 2022-06-11 11:47:26 -04:00
kvm_binary_stats_test.c selftests: KVM: Add exponent check for boolean stats 2022-08-01 08:01:23 -04:00
kvm_create_max_vcpus.c KVM: selftests: Add TEST_REQUIRE macros to reduce skipping copy+paste 2022-06-11 11:47:29 -04:00
kvm_page_table_test.c KVM: selftests: Drop now-unnecessary ucall_uninit() 2022-11-16 16:58:53 -08:00
Makefile Merge branch 'kvm-svm-harden' into HEAD 2022-11-17 11:51:09 -05:00
max_guest_memory_test.c KVM: selftests: Add atoi_positive() and atoi_non_negative() for input validation 2022-11-16 10:03:24 -08:00
memslot_modification_stress_test.c KVM: selftests: Rename perf_test_util symbols to memstress 2022-11-16 10:58:32 -08:00
memslot_perf_test.c KVM: selftests: move common startup logic to kvm_util.c 2022-11-16 16:58:56 -08:00
rseq_test.c KVM: selftests: move common startup logic to kvm_util.c 2022-11-16 16:58:56 -08:00
set_memory_region_test.c KVM: selftests: move common startup logic to kvm_util.c 2022-11-16 16:58:56 -08:00
settings selftests: kvm: Raise the default timeout to 120 seconds 2021-02-09 08:17:08 -05:00
steal_time.c KVM: selftests: Automatically do init_ucall() for non-barebones VMs 2022-11-16 16:58:51 -08:00
system_counter_offset_test.c KVM: selftests: Automatically do init_ucall() for non-barebones VMs 2022-11-16 16:58:51 -08:00