All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tina Zhang" <zhang_wei@open-hieco.net>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v3 8/9] KVM: nSVM: Advertise DecodeAssists to L1
Date: Thu, 30 Jul 2026 12:33:16 +0000	[thread overview]
Message-ID: <20260730123316.AC92B1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <29c2042af283e6d1a0b928b78d944b499153dace.1785411877.git.zhang_wei@open-hieco.net>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing VENDOR_F(DECODEASSISTS) initialization in CPUID 0x8000000A leaf definition.
--

--- Patch [8]: [PATCH v3 8/9] KVM: nSVM: Advertise DecodeAssists to L1 ---
commit 2694559bd05c1133d7f21075f9c95dc19418651a
Author: Tina Zhang <zhang_wei@open-hieco.net>

KVM: nSVM: Advertise DecodeAssists to L1

This patch advertises DecodeAssists to L1 guests by checking and setting
the X86_FEATURE_DECODEASSISTS capability when supported by hardware. This
enables QEMU configurations that enforce the decodeassists feature.

> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 6e2ceb700567c..4e01a6ede4246 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -5588,6 +5588,8 @@ static __init void svm_set_cpu_caps(void)
>  		 */
>  		kvm_cpu_cap_set(X86_FEATURE_FLUSHBYASID);
>  
> +		kvm_cpu_cap_check_and_set(X86_FEATURE_DECODEASSISTS);

[Severity: Low]
Does this feature also need to be initialized in arch/x86/kvm/cpuid.c?

Currently, kvm_cpu_cap_check_and_set() is used here to enable it, but
VENDOR_F(DECODEASSISTS) appears to be missing from the CPUID_8000_000A_EDX
capabilities array in cpuid.c:

arch/x86/kvm/cpuid.c:kvm_cpu_cap_init() {
    /* All SVM features required additional vendor module enabling. */
    kvm_cpu_cap_init(CPUID_8000_000A_EDX,
        VENDOR_F(NPT),
        VENDOR_F(VMCBCLEAN),
        ...
}

Without VENDOR_F(DECODEASSISTS), this skips KVM's standard compile-time
validation and raw CPUID masking logic. Should it be added to the vendor
feature list as well?

> +
>  		if (nrips)
>  			kvm_cpu_cap_set(X86_FEATURE_NRIPS);
>

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1785411877.git.zhang_wei@open-hieco.net?part=8

  reply	other threads:[~2026-07-30 12:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 12:08 [PATCH v3 0/9] KVM: nSVM: Enable DecodeAssists for nested guests Tina Zhang
2026-07-30 12:08 ` [PATCH v3 1/9] KVM: x86: Add helper to provide intercept linear addresses Tina Zhang
2026-07-30 12:38   ` sashiko-bot
2026-07-30 12:08 ` [PATCH v3 2/9] KVM: nSVM: Synthesize DecodeAssists EXITINFO for emulated intercepts Tina Zhang
2026-07-30 12:30   ` sashiko-bot
2026-07-30 12:08 ` [PATCH v3 3/9] KVM: nSVM: Track hardware-provided instruction bytes Tina Zhang
2026-07-30 12:34   ` sashiko-bot
2026-07-30 12:08 ` [PATCH v3 4/9] KVM: nSVM: Propagate hardware DecodeAssist bytes to VMCB12 Tina Zhang
2026-07-30 12:08 ` [PATCH v3 5/9] KVM: x86: Track emulator-originated nested #PF VM-Exits Tina Zhang
2026-07-30 12:08 ` [PATCH v3 6/9] KVM: nSVM: Use emulator bytes for synthesized nested #NPF/#PF Tina Zhang
2026-07-30 12:08 ` [PATCH v3 7/9] KVM: nSVM: Fetch missing DecodeAssist bytes for synthesized #NPF/#PF Tina Zhang
2026-07-30 12:31   ` sashiko-bot
2026-07-30 12:08 ` [PATCH v3 8/9] KVM: nSVM: Advertise DecodeAssists to L1 Tina Zhang
2026-07-30 12:33   ` sashiko-bot [this message]
2026-07-30 12:08 ` [PATCH v3 9/9] KVM: selftests: Add nested SVM DecodeAssists test Tina Zhang
2026-07-30 12:34   ` sashiko-bot

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=20260730123316.AC92B1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=zhang_wei@open-hieco.net \
    /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.