Skip to content
Commit 204c91ef authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

KVM: selftests: do not blindly clobber registers in guest asm



The guest_code of sync_regs_test is assuming that the compiler will not
touch %r11 outside the asm that increments it, which is a bit brittle.
Instead, we can increment a variable and use a dummy asm to ensure the
increment is not optimized away.  However, we also need to use a
callee-save register or the compiler will insert a save/restore around
the vmexit, breaking the whole idea behind the test.

(Yes, "if it ain't broken...", but I would like the test to be clean
before it is copied into the upcoming s390 selftests).

Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 12e9612c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment