[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1e41a634-0419-e0a8-364c-2e30ed2dbe4d@redhat.com>
Date: Wed, 10 Aug 2022 14:29:02 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Gavin Shan <gshan@...hat.com>
Cc: kvmarm <kvmarm@...ts.cs.columbia.edu>,
KVM list <kvm@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-kselftest <linux-kselftest@...r.kernel.org>,
Florian Weimer <fweimer@...hat.com>,
shan gavin <shan.gavin@...il.com>, maz <maz@...nel.org>,
andrew jones <andrew.jones@...ux.dev>,
yihyu <yihyu@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
oliver upton <oliver.upton@...ux.dev>
Subject: Re: [PATCH v2 1/2] KVM: selftests: Make rseq compatible with
glibc-2.35
On 8/10/22 14:22, Mathieu Desnoyers wrote:
>>
>> /*
>> * Create and run a dummy VM that immediately exits to userspace via
>> @@ -256,7 +244,7 @@ int main(int argc, char *argv[])
>> */
>> smp_rmb();
>> cpu = sched_getcpu();
>> - rseq_cpu = READ_ONCE(__rseq.cpu_id);
>> + rseq_cpu = READ_ONCE(__rseq->cpu_id);
> #include <rseq.h>
>
> and use
>
> rseq_current_cpu_raw().
Thanks, I squashed it and queued it for -rc1 (tested on both
glibc 2.34 and 2.35).
diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selftests/kvm/rseq_test.c
index 84e8425edc2c..987a76674f4f 100644
--- a/tools/testing/selftests/kvm/rseq_test.c
+++ b/tools/testing/selftests/kvm/rseq_test.c
@@ -29,7 +29,6 @@
#define NR_TASK_MIGRATIONS 100000
static pthread_t migration_thread;
-static struct rseq_abi *__rseq;
static cpu_set_t possible_mask;
static int min_cpu, max_cpu;
static bool done;
@@ -218,7 +217,6 @@ int main(int argc, char *argv[])
r = rseq_register_current_thread();
TEST_ASSERT(!r, "rseq_register_current_thread failed, errno = %d (%s)",
errno, strerror(errno));
- __rseq = rseq_get_abi();
/*
* Create and run a dummy VM that immediately exits to userspace via
@@ -256,7 +254,7 @@ int main(int argc, char *argv[])
*/
smp_rmb();
cpu = sched_getcpu();
- rseq_cpu = READ_ONCE(__rseq->cpu_id);
+ rseq_cpu = rseq_current_cpu_raw();
smp_rmb();
} while (snapshot != atomic_read(&seq_cnt));
Paolo
Powered by blists - more mailing lists