From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: YueHaibing <yuehaibing@huawei.com>,
pbonzini@redhat.com, shuah@kernel.org, gshan@redhat.com,
peterz@infradead.org
Cc: kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] KVM: selftests: Fix build error
Date: Mon, 30 Jan 2023 10:50:18 -0500 [thread overview]
Message-ID: <946da82b-4792-fd0b-9b01-d64bacb17578@efficios.com> (raw)
In-Reply-To: <20230130124445.3476-1-yuehaibing@huawei.com>
On 2023-01-30 07:44, YueHaibing wrote:
> kvm selftests build fails with below info:
>
> rseq_test.c:48:13: error: conflicting types for ‘sys_getcpu’; have ‘void(unsigned int *)’
> 48 | static void sys_getcpu(unsigned *cpu)
> | ^~~~~~~~~~
> In file included from rseq_test.c:23:
> ../rseq/rseq.c:82:12: note: previous definition of ‘sys_getcpu’ with type ‘int(unsigned int *, unsigned int *)’
> 82 | static int sys_getcpu(unsigned *cpu, unsigned *node)
> | ^~~~~~~~~~
>
> commit 66d42ac73fc6 ("KVM: selftests: Make rseq compatible with glibc-2.35")
> has include "../rseq/rseq.c", and commit 99babd04b250 ("selftests/rseq: Implement rseq numa node id field selftest")
> add sys_getcpu() implement, so use sys_getcpu in rseq/rseq.c to fix this.
>
> Fixes: 99babd04b250 ("selftests/rseq: Implement rseq numa node id field selftest")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Hi,
This patch replicates an already existing patch:
https://lore.kernel.org/all/20230106-fix-kvm-rseq-build-v1-1-b704d9831d02@kernel.org/
The original patch should be routed through the tip tree by Peter Zijlstra shortly.
Thanks,
Mathieu
> ---
> tools/testing/selftests/kvm/rseq_test.c | 19 ++++++-------------
> 1 file changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/rseq_test.c b/tools/testing/selftests/kvm/rseq_test.c
> index 3045fdf9bdf5..69ff39aa2991 100644
> --- a/tools/testing/selftests/kvm/rseq_test.c
> +++ b/tools/testing/selftests/kvm/rseq_test.c
> @@ -41,18 +41,6 @@ static void guest_code(void)
> GUEST_SYNC(0);
> }
>
> -/*
> - * We have to perform direct system call for getcpu() because it's
> - * not available until glic 2.29.
> - */
> -static void sys_getcpu(unsigned *cpu)
> -{
> - int r;
> -
> - r = syscall(__NR_getcpu, cpu, NULL, NULL);
> - TEST_ASSERT(!r, "getcpu failed, errno = %d (%s)", errno, strerror(errno));
> -}
> -
> static int next_cpu(int cpu)
> {
> /*
> @@ -249,7 +237,12 @@ int main(int argc, char *argv[])
> * across the seq_cnt reads.
> */
> smp_rmb();
> - sys_getcpu(&cpu);
> + /*
> + * We have to perform direct system call for getcpu() because it's
> + * not available until glic 2.29.
> + */
> + r = sys_getcpu(&cpu, NULL);
> + TEST_ASSERT(!r, "getcpu failed, errno = %d (%s)", errno, strerror(errno));
> rseq_cpu = rseq_current_cpu_raw();
> smp_rmb();
> } while (snapshot != atomic_read(&seq_cnt));
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
prev parent reply other threads:[~2023-01-30 15:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 12:44 [PATCH -next] KVM: selftests: Fix build error YueHaibing
2023-01-30 15:50 ` Mathieu Desnoyers [this message]
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=946da82b-4792-fd0b-9b01-d64bacb17578@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=gshan@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=shuah@kernel.org \
--cc=yuehaibing@huawei.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