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: <20220905053550.ltovrnpu6tlxqje3@yy-desk-7060>
Date:   Mon, 5 Sep 2022 13:35:50 +0800
From:   Yuan Yao <yuan.yao@...ux.intel.com>
To:     isaku.yamahata@...el.com
Cc:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        Paolo Bonzini <pbonzini@...hat.com>,
        Sean Christopherson <seanjc@...gle.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Marc Zyngier <maz@...nel.org>, Will Deacon <will@...nel.org>,
        isaku.yamahata@...il.com, Kai Huang <kai.huang@...el.com>,
        Chao Gao <chao.gao@...el.com>,
        Atish Patra <atishp@...shpatra.org>,
        Shaokun Zhang <zhangshaokun@...ilicon.com>,
        Qi Liu <liuqi115@...wei.com>,
        John Garry <john.garry@...wei.com>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Huang Ying <ying.huang@...el.com>,
        Huacai Chen <chenhuacai@...nel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Borislav Petkov <bp@...en8.de>
Subject: Re: [PATCH v3 02/22] KVM: x86: Use this_cpu_ptr() instead of
 per_cpu_ptr(smp_processor_id())

On Thu, Sep 01, 2022 at 07:17:37PM -0700, isaku.yamahata@...el.com wrote:
> From: Isaku Yamahata <isaku.yamahata@...el.com>
>
> convert per_cpu_ptr(smp_processor_id()) to this_cpu_ptr() as trivial
> cleanup.

Reviewed-by: Yuan Yao <yuan.yao@...el.com>

>
> Signed-off-by: Isaku Yamahata <isaku.yamahata@...el.com>
> Reviewed-by: Chao Gao <chao.gao@...el.com>
> ---
>  arch/x86/kvm/x86.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 0e200fe44b35..fd021581ca60 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -428,8 +428,7 @@ static void kvm_user_return_msr_init_cpu(struct kvm_user_return_msrs *msrs)
>
>  int kvm_set_user_return_msr(unsigned slot, u64 value, u64 mask)
>  {
> -	unsigned int cpu = smp_processor_id();
> -	struct kvm_user_return_msrs *msrs = per_cpu_ptr(user_return_msrs, cpu);
> +	struct kvm_user_return_msrs *msrs = this_cpu_ptr(user_return_msrs);
>  	int err;
>
>  	kvm_user_return_msr_init_cpu(msrs);
> @@ -453,8 +452,7 @@ EXPORT_SYMBOL_GPL(kvm_set_user_return_msr);
>
>  static void drop_user_return_notifiers(void)
>  {
> -	unsigned int cpu = smp_processor_id();
> -	struct kvm_user_return_msrs *msrs = per_cpu_ptr(user_return_msrs, cpu);
> +	struct kvm_user_return_msrs *msrs = this_cpu_ptr(user_return_msrs);
>
>  	if (msrs->registered)
>  		kvm_on_user_return(&msrs->urn);
> --
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ