Re: [PATCH 3/3] KVM: VMX: Rename posted interrupt prefixes from "vmx" to "vt"

[email protected]
Newsgroups org.kernel.vger.kvm
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Low] The function `vmx_needs_pi_wakeup()` was not renamed to `vt_needs_pi_wakeup()`.
- [Low] The shared inline API `__vmx_deliver_posted_interrupt()` was not renamed to `__vt_deliver_posted_interrupt()`.
- [Low] A comment inside `vt_can_use_vtd_pi()` references the old `vmx_pi_start_bypass()` function name.
--

--- Patch [3]: [PATCH 3/3] KVM: VMX: Rename posted interrupt prefixes from "vmx" to "vt" ---
commit 735ede2af83c20ffbbfab70a4d63203f6ab6beab
Author: Sean Christopherson <[email protected]>

KVM: VMX: Rename posted interrupt prefixes from "vmx" to "vt"

Rename all common posted interrupt APIs that use a "vmx" prefix to instead
use a "vt" prefix to capture that they are used for both VMX and TDX vCPUs.

[Severity: Low]
This isn't a bug, but should __vmx_deliver_posted_interrupt() in
arch/x86/kvm/vmx/common.h also be renamed? It appears to be a common API
used by TDX code (tdx_deliver_interrupt() in arch/x86/kvm/vmx/tdx.c).

No functional change intended.

Signed-off-by: Sean Christopherson <[email protected]>

> diff --git a/arch/x86/kvm/vmx/posted_intr.c b/arch/x86/kvm/vmx/posted_intr.c
> index 24221ba553be1..7a6a445870442 100644
> --- a/arch/x86/kvm/vmx/posted_intr.c
> +++ b/arch/x86/kvm/vmx/posted_intr.c

[ ... ]

> @@ -146,7 +146,7 @@ void vmx_vcpu_pi_load(struct kvm_vcpu *vcpu, int cpu)
>  		pi_set_on(pi_desc);
>  }
>  
> -static bool vmx_can_use_vtd_pi(struct kvm *kvm)
> +static bool vt_can_use_vtd_pi(struct kvm *kvm)
>  {
>  	/*
>  	 * Note, reading the number of possible bypass IRQs can race with a

[Severity: Low]
This isn't a bug, but the comment just below this line still references the
old name: "vmx_pi_start_bypass() ensures blockng vCPUs will see...". Should
this be updated to vt_pi_start_bypass()?

[ ... ]

> @@ -219,10 +219,10 @@ static bool vmx_needs_pi_wakeup(struct kvm_vcpu *vcpu)
>  	 * back to the pi_wakeup_handler() function.
>  	 */
>  	return (vmx_can_use_ipiv(vcpu) && !is_td_vcpu(vcpu)) ||
> -		vmx_can_use_vtd_pi(vcpu->kvm);
> +		vt_can_use_vtd_pi(vcpu->kvm);
>  }

[Severity: Low]
This isn't a bug, but should vmx_needs_pi_wakeup() also be renamed to
vt_needs_pi_wakeup()? It explicitly handles both VMX and TDX cases by
checking is_td_vcpu(vcpu).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.