From: Huacai Chen <chenhuacai@kernel.org>
To: Bibo Mao <maobibo@loongson.cn>
Cc: Tianrui Zhao <zhaotianrui@loongson.cn>,
WANG Xuerui <kernel@xen0n.name>,
kvm@vger.kernel.org, loongarch@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] LoongArch: KVM: Set host with kernel mode when switch to VM mode
Date: Sun, 9 Feb 2025 17:47:38 +0800 [thread overview]
Message-ID: <CAAhV-H4o7WS6J-eU=3VR16iVscrr5znpa67Do96cxmd6A0JS0g@mail.gmail.com> (raw)
In-Reply-To: <20250207032634.2333300-4-maobibo@loongson.cn>
Hi, Bibo,
On Fri, Feb 7, 2025 at 11:26 AM Bibo Mao <maobibo@loongson.cn> wrote:
>
> PRMD and ERA register is only meaningful on the beginning stage
> of exception entry, and it can be overwritten for nested irq or
> exception.
The code doesn't touch ERA, so ERA in the commit message is a typo?
Huacai
>
> When CPU runs in VM mode, interrupt need be enabled on host. And the
> mode for host had better be kernel mode rather than random.
>
> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
> ---
> arch/loongarch/kvm/switch.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/loongarch/kvm/switch.S b/arch/loongarch/kvm/switch.S
> index 0c292f818492..1be185e94807 100644
> --- a/arch/loongarch/kvm/switch.S
> +++ b/arch/loongarch/kvm/switch.S
> @@ -85,7 +85,7 @@
> * Guest CRMD comes from separate GCSR_CRMD register
> */
> ori t0, zero, CSR_PRMD_PIE
> - csrxchg t0, t0, LOONGARCH_CSR_PRMD
> + csrwr t0, LOONGARCH_CSR_PRMD
>
> /* Set PVM bit to setup ertn to guest context */
> ori t0, zero, CSR_GSTAT_PVM
> --
> 2.39.3
>
next prev parent reply other threads:[~2025-02-09 9:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 3:26 [PATCH 0/3] LoongArch: KVM: Some tiny code cleanup Bibo Mao
2025-02-07 3:26 ` [PATCH 1/3] LoongArch: KVM: Fix typo issue about GCFG feature detection Bibo Mao
2025-02-09 9:38 ` Huacai Chen
2025-02-10 1:41 ` bibo mao
2025-02-10 3:58 ` Huacai Chen
2025-02-10 6:32 ` bibo mao
2025-02-07 3:26 ` [PATCH 2/3] LoongArch: KVM: Remove duplicated cache attribute setting Bibo Mao
2025-02-07 3:26 ` [PATCH 3/3] LoongArch: KVM: Set host with kernel mode when switch to VM mode Bibo Mao
2025-02-09 9:47 ` Huacai Chen [this message]
2025-02-10 1:43 ` bibo mao
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-H4o7WS6J-eU=3VR16iVscrr5znpa67Do96cxmd6A0JS0g@mail.gmail.com' \
--to=chenhuacai@kernel.org \
--cc=kernel@xen0n.name \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®