From: Gavin Shan <gshan@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: kvmarm <kvmarm@lists.cs.columbia.edu>,
KVM list <kvm@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-kselftest <linux-kselftest@vger.kernel.org>,
Florian Weimer <fweimer@redhat.com>,
shan gavin <shan.gavin@gmail.com>, maz <maz@kernel.org>,
andrew jones <andrew.jones@linux.dev>, yihyu <yihyu@redhat.com>,
Sean Christopherson <seanjc@google.com>,
oliver upton <oliver.upton@linux.dev>
Subject: Re: [PATCH v2 1/2] KVM: selftests: Make rseq compatible with glibc-2.35
Date: Thu, 11 Aug 2022 09:57:32 +1000 [thread overview]
Message-ID: <234b81a0-d7eb-ee92-3ed3-ce2abf566b63@redhat.com> (raw)
In-Reply-To: <1e41a634-0419-e0a8-364c-2e30ed2dbe4d@redhat.com>
On 8/10/22 10:29 PM, Paolo Bonzini wrote:
> 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).
>
Paolo, Thanks for the makeup, which looks good to me :)
> 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));
>
next prev parent reply other threads:[~2022-08-10 23:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-10 10:41 [PATCH v2 0/2] kvm/selftests: Two rseq_test fixes Gavin Shan
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 [this message]
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=234b81a0-d7eb-ee92-3ed3-ce2abf566b63@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