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]
Message-ID: <Ygvd9Q+R+tt6WfC2@google.com>
Date:   Tue, 15 Feb 2022 17:08:05 +0000
From:   Sean Christopherson <seanjc@...gle.com>
To:     Paolo Bonzini <pbonzini@...hat.com>
Cc:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Subject: Re: [PATCH v2 2/5] KVM: x86: remove KVM_X86_OP_NULL and mark
 optional kvm_x86_ops

On Mon, Feb 14, 2022, Paolo Bonzini wrote:
> The original use of KVM_X86_OP_NULL, which was to mark calls
> that do not follow a specific naming convention, is not in use
> anymore.  Instead, let's mark calls that are optional because
> they are always invoked within conditionals or with static_call_cond.
> Those that are _not_, i.e. those that are defined with KVM_X86_OP,
> must be defined by both vendor modules or some kind of NULL pointer
> dereference is bound to happen at runtime.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@...hat.com>
> ---
>  arch/x86/include/asm/kvm-x86-ops.h | 84 +++++++++++++++---------------
>  arch/x86/include/asm/kvm_host.h    |  4 +-
>  arch/x86/kvm/x86.c                 |  2 +-
>  3 files changed, 44 insertions(+), 46 deletions(-)
> 
> diff --git a/arch/x86/include/asm/kvm-x86-ops.h b/arch/x86/include/asm/kvm-x86-ops.h
> index 9e37dc3d8863..9415d9af204c 100644
> --- a/arch/x86/include/asm/kvm-x86-ops.h
> +++ b/arch/x86/include/asm/kvm-x86-ops.h
> @@ -1,25 +1,23 @@
>  /* SPDX-License-Identifier: GPL-2.0 */
> -#if !defined(KVM_X86_OP) || !defined(KVM_X86_OP_NULL)
> +#if !defined(KVM_X86_OP) || !defined(KVM_X86_OP_OPTIONAL)
>  BUILD_BUG_ON(1)
>  #endif
>  
>  /*
> - * KVM_X86_OP() and KVM_X86_OP_NULL() are used to help generate
> + * KVM_X86_OP() and KVM_X86_OP_OPTIONAL() are used to help generate
>   * "static_call()"s. They are also intended for use when defining
> - * the vmx/svm kvm_x86_ops. KVM_X86_OP() can be used for those
> - * functions that follow the [svm|vmx]_func_name convention.
> - * KVM_X86_OP_NULL() can leave a NULL definition for the
> - * case where there is no definition or a function name that
> - * doesn't match the typical naming convention is supplied.
> + * the vmx/svm kvm_x86_ops.

But assuming your veto of actually using kvm-x86-ops to fill vendor ops isn't
overriden, they're _not_ "intended for use when defining the vmx/svm kvm_x86_ops."

> KVM_X86_OP_OPTIONAL() can be used for those
> + * functions that can have a NULL definition, for example if
> + * "static_call_cond()" will be used at the call sites.
>   */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ