From: Huacai Chen <chenhuacai@kernel.org>
To: Bibo Mao <maobibo@loongson.cn>
Cc: cuitao <cuitao@kylinos.cn>,
zhaotianrui@loongson.cn, loongarch@lists.linux.dev,
kernel@xen0n.name
Subject: Re: [PATCH] LoongArch/KVM: Use CSR_CRMD_PLV instead of CSR_PRMD_PPLV in kvm_arch_vcpu_in_kernel
Date: Thu, 9 Apr 2026 19:35:55 +0800 [thread overview]
Message-ID: <CAAhV-H6GLrO4DfmrYxEi4tdP_9FEXJn3b3-o0nVFwZKOEXnFBA@mail.gmail.com> (raw)
In-Reply-To: <b616ef68-2dae-0e6c-65d4-72a8d33af690@loongson.cn>
On Thu, Apr 9, 2026 at 2:35 PM Bibo Mao <maobibo@loongson.cn> wrote:
>
>
>
> On 2026/4/9 下午12:22, cuitao wrote:
> > The function reads LOONGARCH_CSR_CRMD but uses CSR_PRMD_PPLV to
> > extract the privilege level. While both masks have the same value
> > (0x3), CSR_CRMD_PLV is the semantically correct constant for CRMD.
> >
> > Signed-off-by: cuitao <cuitao@kylinos.cn>
> > ---
> > arch/loongarch/kvm/vcpu.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/loongarch/kvm/vcpu.c b/arch/loongarch/kvm/vcpu.c
> > index 831f381a8fd1..ed2cfcd76f60 100644
> > --- a/arch/loongarch/kvm/vcpu.c
> > +++ b/arch/loongarch/kvm/vcpu.c
> > @@ -402,7 +402,7 @@ bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu)
> > val = gcsr_read(LOONGARCH_CSR_CRMD);
> > preempt_enable();
> >
> > - return (val & CSR_PRMD_PPLV) == PLV_KERN;
> > + return (val & CSR_CRMD_PLV) == PLV_KERN;
> > }
> >
> > #ifdef CONFIG_GUEST_PERF_EVENTS
> >
> Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Applied, thanks.
Huacai
>
prev parent reply other threads:[~2026-04-09 11:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 4:22 [PATCH] LoongArch/KVM: Use CSR_CRMD_PLV instead of CSR_PRMD_PPLV in kvm_arch_vcpu_in_kernel cuitao
2026-04-09 6:32 ` Bibo Mao
2026-04-09 11:35 ` Huacai Chen [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=CAAhV-H6GLrO4DfmrYxEi4tdP_9FEXJn3b3-o0nVFwZKOEXnFBA@mail.gmail.com \
--to=chenhuacai@kernel.org \
--cc=cuitao@kylinos.cn \
--cc=kernel@xen0n.name \
--cc=loongarch@lists.linux.dev \
--cc=maobibo@loongson.cn \
--cc=zhaotianrui@loongson.cn \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).