[PATCH v9 02/24] KVM: Move architecture capability Kconfigs to header defines

Hendrik Brueckner brueckner at linux.ibm.com
Tue Oct 6 09:01:14 PDT 2026


On Wed, Sep 30, 2026 at 07:34:17PM +0200, Steffen Eiden wrote:
[...]
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -750,7 +750,11 @@ static inline u64 kvm_gmem_get_supported_flags(struct kvm *kvm)
>  #ifndef kvm_arch_has_readonly_mem
>  static inline bool kvm_arch_has_readonly_mem(struct kvm *kvm)
>  {
> -	return IS_ENABLED(CONFIG_HAVE_KVM_READONLY_MEM);
> +#ifdef KVM_READONLY_MEM
> +	return true;
> +#else
> +	return false;
> +#endif
>  }
>  #endif

Minor style nit: maybe remove the preprocessor "noise" from within the function by
defining two versions of them.  Looks a bit cleaner then:

	#ifdef KVM_READONLY_MEM
	static inline bool kvm_arch_has_readonly_mem(struct kvm *kvm)
	{
		return true;
	}
	#else
	static inline bool kvm_arch_has_readonly_mem(struct kvm *kvm)
	{
		return false;
	}
	#endif

However, both versions are fine with me.

Acked-by: Hendrik Brueckner <brueckner at linux.ibm.com>




More information about the linux-arm-kernel mailing list