]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Use getcpu() instead of sched_getcpu() in rseq_test
authorGavin Shan <gshan@redhat.com>
Wed, 10 Aug 2022 10:41:14 +0000 (18:41 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 10 Aug 2022 19:08:29 +0000 (15:08 -0400)
commitebf9627142d36790594c94de8f7392252889db95
tree6f9cf6a0fe9b4ae3d34663f50f96b60b10ad6b62
parent82511caf47fc915741b7342ac230e46c9ee8ccb9
KVM: selftests: Use getcpu() instead of sched_getcpu() in rseq_test

sched_getcpu() is glibc dependent and it can simply return the CPU
ID from the registered rseq information, as Florian Weimer pointed.
In this case, it's pointless to compare the return value from
sched_getcpu() and that fetched from the registered rseq information.

Fix the issue by replacing sched_getcpu() with getcpu(), as Florian
suggested. The comments are modified accordingly by replacing
"sched_getcpu()" with "getcpu()".

Reported-by: Yihuang Yu <yihyu@redhat.com>
Suggested-by: Florian Weimer <fweimer@redhat.com>
Suggested-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Gavin Shan <gshan@redhat.com>
Message-Id: <20220810104114.6838-3-gshan@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/rseq_test.c