From: no-reply@sashiko.virtuozzo.com
To: Konstantin Khorenko <khorenko@virtuozzo.com>,
Pavel Tikhomirov <ptikhomirov@virtuozzo.com>,
Vasileios Almpanis <vasileios.almpanis@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2 6/7] ms/KVM: SVM: Triple fault L1 on unintercepted EFER.SVME clear by L2
Date: Tue, 1 Dec 2026 00:49:01 +0000 [thread overview]
Message-ID: <010701a22f1391f0-99df292a-fa20-4c56-b8d6-a41ac191f84f-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261126-khorenko-vstor-157390-kvm-fixes-v1-6-ea4024e03c63@virtuozzo.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] kvm/svm: comment typo and commit message omits wants_to_run
gating
--
commit 241f9fb2c8d3d5ea8f0d77081ce249af0f7abd5b
Author: Yosry Ahmed <yosry.ahmed@linux.dev>
ms/KVM: SVM: Triple fault L1 on unintercepted EFER.SVME clear by L2
When L2 clears EFER.SVME and L1 does not intercept the write, svm_set_efer() now requests a triple fault for L1 before tearing down the nested state. Previously KVM left guest mode and kept running L1 without injecting a #VMEXIT.
Link: https://patch.msgid.link/20260209195142.2554532-2-yosry.ahmed@linux.dev
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 385b6db1698af..f4e581d35c88b 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -222,6 +222,19 @@ int svm_set_efer(struct kvm_vcpu *vcpu, u64 efer)
>
> if ((old_efer & EFER_SVME) != (efer & EFER_SVME)) {
> if (!(efer & EFER_SVME)) {
> + /*
> + * Architecturally, clearing EFER.SVME while a guest is
> + * running yields undefined behavior, i.e. KVM can do
> + * literally anything. Force the vCPU back into L1 as
> + * that is the safest option for KVM, but synthesize a
> + * triple fault (for L1!) so that KVM at least doesn't
> + * run random L2 code in the context of L1. Do so if
> + * and only if the vCPU is actively running, e.g. to
> + * avoid positives if userspace is stuffing state.
> + */
> + if (is_guest_mode(vcpu) && vcpu->wants_to_run)
> + kvm_make_request(KVM_REQ_TRIPLE_FAULT, vcpu);
[Severity: Low]
This isn't a bug, but the comment says "to avoid positives" where it
presumably means "to avoid false positives".
Also, the commit message does not mention the vcpu->wants_to_run condition.
Because wants_to_run is only set inside KVM_RUN, host-initiated EFER writes
outside KVM_RUN (KVM_SET_SREGS, KVM_SET_NESTED_STATE) do not trigger the
triple fault. Could the changelog say so?
Carry the trailer below into the next revision and Sashiko will not review this patch again.
Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261126-khorenko-vstor-157390-kvm-fixes-v1-0-ea4024e03c63@virtuozzo.com?part=6
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-12-01 0:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 21:52 [Devel] [PATCH hci-8.2 0/7] KVM fixes for the 8.2 kernel Konstantin Khorenko
2026-11-26 21:52 ` [Devel] [PATCH hci-8.2 1/7] ms/KVM: x86/mmu: Conditionally resched when retrying gPTE walk on A/D update failure Konstantin Khorenko
2026-12-01 0:44 ` no-reply
2026-11-26 21:53 ` [Devel] [PATCH hci-8.2 2/7] ms/KVM: x86: Conditionally resched when restarting REP string emulation Konstantin Khorenko
2026-12-01 0:45 ` no-reply
2026-11-26 21:53 ` [Devel] [PATCH hci-8.2 3/7] ms/KVM: nVMX: Process each host MSR entry at most once when unwinding failed VM-Entry Konstantin Khorenko
2026-12-01 0:45 ` no-reply
2026-11-26 21:53 ` [Devel] [PATCH hci-8.2 4/7] ms/KVM: x86/mmu: Cap number of parent PTEs per SP at 1000 (the arbitrary rmap limit) Konstantin Khorenko
2026-12-01 0:46 ` no-reply
2026-11-26 21:53 ` [Devel] [PATCH hci-8.2 5/7] ms/KVM: x86: Unconditionally reset MMU context when emulating INIT Konstantin Khorenko
2026-12-01 0:47 ` no-reply
2026-11-26 21:53 ` [Devel] [PATCH hci-8.2 6/7] ms/KVM: SVM: Triple fault L1 on unintercepted EFER.SVME clear by L2 Konstantin Khorenko
2026-12-01 0:49 ` no-reply [this message]
2026-11-26 21:53 ` [Devel] [PATCH hci-8.2 7/7] ms/KVM: selftests: Add a test for L2 clearing EFER.SVME without intercept Konstantin Khorenko
2026-12-01 0:50 ` no-reply
2026-11-27 14:43 ` [Devel] [PATCH hci-8.2 0/7] KVM fixes for the 8.2 kernel Konstantin Khorenko
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=010701a22f1391f0-99df292a-fa20-4c56-b8d6-a41ac191f84f-000000@eu-central-1.amazonses.com \
--to=no-reply@sashiko.virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
--cc=ptikhomirov@virtuozzo.com \
--cc=vasileios.almpanis@virtuozzo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.