[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220810104114.6838-1-gshan@redhat.com>
Date: Wed, 10 Aug 2022 18:41:12 +0800
From: Gavin Shan <gshan@...hat.com>
To: kvmarm@...ts.cs.columbia.edu
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, fweimer@...hat.com,
shan.gavin@...il.com, maz@...nel.org, andrew.jones@...ux.dev,
mathieu.desnoyers@...icios.com, pbonzini@...hat.com,
yihyu@...hat.com, seanjc@...gle.com, oliver.upton@...ux.dev
Subject: [PATCH v2 0/2] kvm/selftests: Two rseq_test fixes
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
Powered by blists - more mailing lists