]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs
authorSean Christopherson <seanjc@google.com>
Wed, 1 Sep 2021 20:30:29 +0000 (13:30 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Sep 2021 14:24:02 +0000 (10:24 -0400)
commit3bd616c79b1fe4fc82c2f8003619d7ce540dfb30
tree7c77125cb2a0f63622af238ebb9fbea61ba72979
parentc2d9e80ccde090b20c2190e848d26fd5eda7f3b0
KVM: selftests: Add a test for KVM_RUN+rseq to detect task migration bugs

Add a test to verify an rseq's CPU ID is updated correctly if the task is
migrated while the kernel is handling KVM_RUN.  This is a regression test
for a bug introduced by commit dd56d7ba544a ("x86/kvm: Use generic xfer
to guest work function"), where TIF_NOTIFY_RESUME would be cleared by KVM
without updating rseq, leading to a stale CPU ID and other badness.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Message-Id: <20210901203030.1292304-5-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/.gitignore
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/rseq_test.c [new file with mode: 0644]