lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 13 Feb 2023 12:54:44 +0100
From:   Vitaly Kuznetsov <vkuznets@...hat.com>
To:     Sean Christopherson <seanjc@...gle.com>,
        Paolo Bonzini <pbonzini@...hat.com>
Cc:     kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/3] KVM: VMX: Rename "KVM is using eVMCS" static key
 to match its wrapper

Sean Christopherson <seanjc@...gle.com> writes:

> Rename enable_evmcs to __kvm_is_using_evmcs to match its wrapper, and to
> avoid confusion with enabling eVMCS for nested virtualization, i.e. have
> "enable eVMCS" be reserved for "enable eVMCS support for L1".
>
> No functional change intended.
>
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
> ---
>  arch/x86/kvm/vmx/hyperv.c | 2 +-
>  arch/x86/kvm/vmx/hyperv.h | 4 ++--
>  arch/x86/kvm/vmx/vmx.c    | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/hyperv.c b/arch/x86/kvm/vmx/hyperv.c
> index 274fbd38c64e..79450e1ed7cf 100644
> --- a/arch/x86/kvm/vmx/hyperv.c
> +++ b/arch/x86/kvm/vmx/hyperv.c
> @@ -609,7 +609,7 @@ int nested_evmcs_check_controls(struct vmcs12 *vmcs12)
>  }
>  
>  #if IS_ENABLED(CONFIG_HYPERV)
> -DEFINE_STATIC_KEY_FALSE(enable_evmcs);
> +DEFINE_STATIC_KEY_FALSE(__kvm_is_using_evmcs);
>  
>  /*
>   * KVM on Hyper-V always uses the latest known eVMCSv1 revision, the assumption
> diff --git a/arch/x86/kvm/vmx/hyperv.h b/arch/x86/kvm/vmx/hyperv.h
> index a54a2fdf0a5b..9623fe1651c4 100644
> --- a/arch/x86/kvm/vmx/hyperv.h
> +++ b/arch/x86/kvm/vmx/hyperv.h
> @@ -67,11 +67,11 @@ static inline u64 evmcs_read_any(struct hv_enlightened_vmcs *evmcs,
>  
>  #if IS_ENABLED(CONFIG_HYPERV)
>  
> -DECLARE_STATIC_KEY_FALSE(enable_evmcs);
> +DECLARE_STATIC_KEY_FALSE(__kvm_is_using_evmcs);
>  
>  static __always_inline bool kvm_is_using_evmcs(void)
>  {
> -	return static_branch_unlikely(&enable_evmcs);
> +	return static_branch_unlikely(&__kvm_is_using_evmcs);
>  }
>  
>  static __always_inline int get_evmcs_offset(unsigned long field,
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index d80cbe01b5d7..651037b06eb2 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -579,7 +579,7 @@ static __init void hv_init_evmcs(void)
>  
>  		if (enlightened_vmcs) {
>  			pr_info("Using Hyper-V Enlightened VMCS\n");
> -			static_branch_enable(&enable_evmcs);
> +			static_branch_enable(&__kvm_is_using_evmcs);
>  		}
>  
>  		if (ms_hyperv.nested_features & HV_X64_NESTED_DIRECT_FLUSH)

Reviewed-by: Vitaly Kuznetsov <vkuznets@...hat.com>

-- 
Vitaly

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ