From: Gavin Shan <gshan@redhat.com>
To: kvmarm@lists.cs.columbia.edu
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, fweimer@redhat.com,
shan.gavin@gmail.com, maz@kernel.org, andrew.jones@linux.dev,
mathieu.desnoyers@efficios.com, pbonzini@redhat.com,
yihyu@redhat.com, seanjc@google.com, oliver.upton@linux.dev
Subject: [PATCH v2 0/2] kvm/selftests: Two rseq_test fixes
Date: Wed, 10 Aug 2022 18:41:12 +0800 [thread overview]
Message-ID: <20220810104114.6838-1-gshan@redhat.com> (raw)
There are two issues in current rseq_test implementation and the
series intends to fix them:
- From glibc-2.35, rseq information is registered by TLS. It means
rseq_test is unable to register its own rseq information. PATCH[01]
fixes the issue by reusing "../rseq/rseq.c" to fetch TLS's rseq
information if possible.
- sched_getcpu() relies on glibc's implementation and it can simply
returns the CPU ID cached in the rseq information. In this case,
it's pointless to compare the return value from sched_getcpu()
and that fetched from rseq information. PATCH[02] fixes the issue
by replacing sched_getcpu() with getcpu().
v1: https://lore.kernel.org/lkml/8c1f33b4-a5a1-fcfa-4521-36253ffa22c8@redhat.com/T/
Changelog
=========
v2:
* Add "-ldl" to LDLIBS as Florian suggested.
* Reuse "../rseq/rseq.c" as Paolo/Mathieu/Sean suggested.
* Add comments to sys_getcpu() as Sean suggested.
Gavin Shan (2):
KVM: selftests: Make rseq compatible with glibc-2.35
KVM: selftests: Use getcpu() instead of sched_getcpu() in rseq_test
tools/testing/selftests/kvm/Makefile | 5 ++-
tools/testing/selftests/kvm/rseq_test.c | 60 ++++++++++++-------------
2 files changed, 33 insertions(+), 32 deletions(-)
--
2.23.0
next reply other threads:[~2022-08-10 10:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-10 10:41 Gavin Shan [this message]
2022-08-10 10:41 ` [PATCH v2 1/2] KVM: selftests: Make rseq compatible with glibc-2.35 Gavin Shan
2022-08-10 12:22 ` Mathieu Desnoyers
2022-08-10 12:29 ` Paolo Bonzini
2022-08-10 12:30 ` Mathieu Desnoyers
2022-08-10 23:57 ` Gavin Shan
2022-08-10 10:41 ` [PATCH v2 2/2] KVM: selftests: Use getcpu() instead of sched_getcpu() in rseq_test Gavin Shan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220810104114.6838-1-gshan@redhat.com \
--to=gshan@redhat.com \
--cc=andrew.jones@linux.dev \
--cc=fweimer@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=shan.gavin@gmail.com \
--cc=yihyu@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox