[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_69BAA5BB0A332E9E391B034B761B7425E608@qq.com>
Date: Tue, 27 May 2025 13:39:05 +0800
From: Edward Adam Davis <eadavis@...com>
To: binbin.wu@...ux.intel.com
Cc: bp@...en8.de,
dave.hansen@...ux.intel.com,
eadavis@...com,
hpa@...or.com,
kvm@...r.kernel.org,
linux-kernel@...r.kernel.org,
mingo@...hat.com,
pbonzini@...hat.com,
seanjc@...gle.com,
tglx@...utronix.de,
x86@...nel.org
Subject: Re: [PATCH next] KVM: VMX: add noinstr for is_td_vcpu and is_td
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.
Powered by blists - more mailing lists