Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vitaly Kuznetsov" <vkuznets@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 2/4] KVM: nVMX: Make VMPTRST return eVMCS GPA when it is used
Date: Fri, 14 Aug 2026 16:32:07 +0000	[thread overview]
Message-ID: <20260814163207.D8C5D1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260814162221.2144473-3-vkuznets@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Compilation failure when CONFIG_KVM_HYPERV is disabled.
--

--- Patch [2]: [PATCH 2/4] KVM: nVMX: Make VMPTRST return eVMCS GPA when it is used ---
commit e9f713cf2125ef734863ce5fc9c30ea6f602ede7
Author: Vitaly Kuznetsov <vkuznets@redhat.com>

KVM: nVMX: Make VMPTRST return eVMCS GPA when it is used
    
This commit changes the behavior of VMPTRST to return the eVMCS GPA when
eVMCS is active. This aligns KVM's behavior with genuine Hyper-V instead of
returning 1 without skipping the instruction.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=221841

> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index c78c67525ac9b..d13a4d47bc68f 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
[ ... ]
> @@ -5958,8 +5958,14 @@ static int handle_vmptrst(struct kvm_vcpu *vcpu)
>  	if (!nested_vmx_check_permission(vcpu))
>  		return 1;
>  
> -	if (unlikely(nested_vmx_is_evmptr12_valid(to_vmx(vcpu))))
> -		return 1;
> +	/*
> +	 * Hyper-V TLFS does not specify the behavior of VMPTRST when eVMCS is used
> +	 * but genuine Hyper-V seems to be returning eVMCS GPA.
> +	 */
> +	if (nested_vmx_is_evmptr12_valid(to_vmx(vcpu)))
> +		current_vmptr = to_vmx(vcpu)->nested.hv_evmcs_vmptr;

[Severity: Low]
Will this cause a build failure when CONFIG_KVM_HYPERV is disabled?

Because nested_vmx_is_evmptr12_valid() is a static inline function rather
than a preprocessor macro, the compiler still evaluates and type-checks
this branch even when the helper is hardcoded to return false. If the
hv_evmcs_vmptr member in struct nested_vmx is conditionally compiled based
on CONFIG_KVM_HYPERV, the compiler will fail to find it here.

> +	else
> +		current_vmptr = to_vmx(vcpu)->nested.current_vmptr;
>  
>  	if (get_vmx_mem_address(vcpu, exit_qual, instr_info,
[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260814162221.2144473-1-vkuznets@redhat.com?part=2

  reply	other threads:[~2026-08-14 16:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 16:22 [PATCH 0/4] KVM: nVMX: Adjust VMPTRLD/VMPTRST behavior with active eVMCS Vitaly Kuznetsov
2026-08-14 16:22 ` [PATCH 1/4] KVM: nVMX: Make VMPTRLD result in #UD when eVMCS is used Vitaly Kuznetsov
2026-08-14 16:31   ` sashiko-bot
2026-08-14 16:43     ` Sean Christopherson
2026-08-14 16:22 ` [PATCH 2/4] KVM: nVMX: Make VMPTRST return eVMCS GPA when it " Vitaly Kuznetsov
2026-08-14 16:32   ` sashiko-bot [this message]
2026-08-14 16:44     ` Sean Christopherson
2026-08-14 16:22 ` [PATCH 3/4] KVM: selftests: Adapt to the updated VMPTRST behavior when eVMCS " Vitaly Kuznetsov
2026-08-14 16:31   ` sashiko-bot
2026-08-14 16:22 ` [PATCH 4/4] KVM: selftests: Check VMPTRLD with active eVMCS Vitaly Kuznetsov
2026-08-14 16:31   ` 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=20260814163207.D8C5D1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkuznets@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox