From: sashiko-bot@kernel.org
To: "Tao Cui" <cui.tao@linux.dev>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v4 1/3] LoongArch: KVM: Add PV TLB flush support via steal-time shared memory
Date: Mon, 15 Jun 2026 08:35:00 +0000 [thread overview]
Message-ID: <20260615083501.44DD11F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260615082154.42144-2-cui.tao@linux.dev>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] KVM_FEATURE_PV_TLB_FLUSH is unconditionally enabled by default, breaking capability negotiation and live migration.
--
commit f9022e883153b129074818c0b5b2ff53a144e2f5
Author: Tao Cui <cuitao@kylinos.cn>
LoongArch: KVM: Add PV TLB flush support via steal-time shared memory
This commit implements paravirtualized TLB flushes for LoongArch guests using
the preempted byte in the steal-time shared memory page. It introduces the
KVM_VCPU_FLUSH_TLB flag to avoid sending IPIs when the target vCPU is
currently preempted.
[ ... ]
> diff --git a/arch/loongarch/kvm/vm.c b/arch/loongarch/kvm/vm.c
> index 1317c718f896a..cfba45a7343c5 100644
> --- a/arch/loongarch/kvm/vm.c
> +++ b/arch/loongarch/kvm/vm.c
> @@ -54,8 +54,10 @@ static void kvm_vm_init_features(struct kvm *kvm)
> if (kvm_pvtime_supported()) {
> kvm->arch.pv_features |= BIT(KVM_FEATURE_PREEMPT);
> kvm->arch.pv_features |= BIT(KVM_FEATURE_STEAL_TIME);
> + kvm->arch.pv_features |= BIT(KVM_FEATURE_PV_TLB_FLUSH);
> kvm->arch.kvm_features |= BIT(KVM_LOONGARCH_VM_FEAT_PV_PREEMPT);
> kvm->arch.kvm_features |= BIT(KVM_LOONGARCH_VM_FEAT_PV_STEALTIME);
> + kvm->arch.kvm_features |= BIT(KVM_LOONGARCH_VM_FEAT_PV_TLB_FLUSH);
[Severity: High]
Should this new guest-visible feature be disabled by default?
If a VM starts on a kernel with this feature enabled by default, the guest
will detect and use PV TLB flushes. If that VM is later live-migrated to an
older kernel that lacks PV TLB flush support, the destination host will
silently ignore the KVM_VCPU_FLUSH_TLB flag in the steal-time structure.
Could this lead to the guest assuming its TLB was flushed when it wasn't,
resulting in stale translations or memory corruption? Would it be safer to
require an explicit userspace capability enablement before exposing this
to the guest?
> }
> }
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260615082154.42144-1-cui.tao@linux.dev?part=1
next prev parent reply other threads:[~2026-06-15 8:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 8:21 [PATCH v4 0/3] LoongArch: KVM: Add PV TLB flush support Tao Cui
2026-06-15 8:21 ` [PATCH v4 1/3] LoongArch: KVM: Add PV TLB flush support via steal-time shared memory Tao Cui
2026-06-15 8:35 ` sashiko-bot [this message]
2026-06-15 8:21 ` [PATCH v4 2/3] LoongArch: KVM: Implement guest-side PV TLB flush Tao Cui
2026-06-15 8:21 ` [PATCH v4 3/3] KVM: selftests: loongarch: Add PV TLB flush performance test Tao Cui
2026-06-15 8:29 ` sashiko-bot
2026-06-15 9:24 ` 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=20260615083501.44DD11F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=cui.tao@linux.dev \
--cc=kvm@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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