On Tue, 27 May 2025 13:31:12 +0800, Binbin Wu wrote: > noinstr is not needed when the functions are __always_inline. Right. > > > > > #else > > > > -static inline bool is_td(struct kvm *kvm) { return false; } > > -static inline bool is_td_vcpu(struct kvm_vcpu *vcpu) { return false; } > > +static noinstr bool is_td(struct kvm *kvm) { return false; } > > +static noinstr bool is_td_vcpu(struct kvm_vcpu *vcpu) { return false; } > > Oops, overlooked the !CONFIG_KVM_INTEL_TDX case. > > How about: > > diff --git a/arch/x86/kvm/vmx/common.h b/arch/x86/kvm/vmx/common.h > index 8f46a06e2c44..a0c5e8781c33 100644 > --- a/arch/x86/kvm/vmx/common.h > +++ b/arch/x86/kvm/vmx/common.h > @@ -71,8 +71,8 @@ static __always_inline bool is_td_vcpu(struct kvm_vcpu *vcpu) > > #else > > -static inline bool is_td(struct kvm *kvm) { return false; } > -static inline bool is_td_vcpu(struct kvm_vcpu *vcpu) { return false; } > +static __always_inline bool is_td(struct kvm *kvm) { return false; } > +static __always_inline bool is_td_vcpu(struct kvm_vcpu *vcpu) { return false; } Looks good.