[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <62c029b7-13dc-f4fc-d67a-7bd86f973e2f@loongson.cn>
Date: Mon, 22 Jul 2024 14:54:41 +0800
From: maobibo <maobibo@...ngson.cn>
To: Uros Bizjak <ubizjak@...il.com>, linux-kernel@...r.kernel.org
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...nel.org>,
Will Deacon <will@...nel.org>, Waiman Long <longman@...hat.com>,
Boqun Feng <boqun.feng@...il.com>
Subject: Re: [PATCH] locking/pvqspinlock: Correct the type of "old" variable
in pv_kick_node()
Uros,
Sorry for late reply because of weekend time. This modification works
well for me.
In later I want to define pv_node::state as int type on LoongArch
because there is only int32/int64 cmpxchg is better supported on the
system, however that is another issue.
Tested-by:Bibo Mao <maobibo@...ngson.cn>
On 2024/7/22 上午12:45, Uros Bizjak wrote:
> "enum vcpu_state" is not compatible with "u8" type for all targets,
> resulting in:
>
> error: initialization of 'u8 *' {aka 'unsigned char *'} from incompatible pointer type 'enum vcpu_state *'
>
> for LoongArch. Correct the type of "old" variable to "u8".
>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Ingo Molnar <mingo@...nel.org>
> Cc: Will Deacon <will@...nel.org>
> Cc: Waiman Long <longman@...hat.com>
> Cc: Boqun Feng <boqun.feng@...il.com>
> Fixes: fea0e1820b51 ("locking/pvqspinlock: Use try_cmpxchg() in qspinlock_paravirt.h")
> Reported-by: Bibo Mao <maobibo@...ngson.cn>
> Signed-off-by: Uros Bizjak <ubizjak@...il.com>
> Closes: https://lore.kernel.org/lkml/20240719024010.3296488-1-maobibo@loongson.cn/
> ---
> kernel/locking/qspinlock_paravirt.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/locking/qspinlock_paravirt.h b/kernel/locking/qspinlock_paravirt.h
> index f5a36e67b593..ac2e22502741 100644
> --- a/kernel/locking/qspinlock_paravirt.h
> +++ b/kernel/locking/qspinlock_paravirt.h
> @@ -357,7 +357,7 @@ static void pv_wait_node(struct mcs_spinlock *node, struct mcs_spinlock *prev)
> static void pv_kick_node(struct qspinlock *lock, struct mcs_spinlock *node)
> {
> struct pv_node *pn = (struct pv_node *)node;
> - enum vcpu_state old = vcpu_halted;
> + u8 old = vcpu_halted;
> /*
> * If the vCPU is indeed halted, advance its state to match that of
> * pv_wait_node(). If OTOH this fails, the vCPU was running and will
>
Powered by blists - more mailing lists