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: <KL1PR02MB47882A3A37249394CB6B5D84C6EC9@KL1PR02MB4788.apcprd02.prod.outlook.com>
Date:   Fri, 30 Jul 2021 08:22:23 +0000
From:   苏辉(Robert Su) <suhui@...u.com>
To:     Reinette Chatre <reinette.chatre@...el.com>,
        "fenghua.yu@...el.com" <fenghua.yu@...el.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>, "x86@...nel.org" <x86@...nel.org>,
        "hpa@...or.com" <hpa@...or.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: 回复: [PATCH] x86/intel_rdt: use __this_cpu_read in pseudo_lock_fn()

Hi, Reinette:

    There is no issue here, i just think it's better to use __this_cpu_read when
interrupt disabled.

________________________________________
发件人: Reinette Chatre <reinette.chatre@...el.com>
发送时间: 2021年7月28日 2:56
收件人: 苏辉(Robert Su); fenghua.yu@...el.com; tglx@...utronix.de; mingo@...hat.com; bp@...en8.de; x86@...nel.org; hpa@...or.com; linux-kernel@...r.kernel.org
主题: Re: [PATCH] x86/intel_rdt: use __this_cpu_read in pseudo_lock_fn()

Hi,

On 7/22/2021 7:33 PM, Hui Su wrote:
> The code is executed with interrupts disabled,
> so it's safe to use __this_cpu_read().

True ... but could you please elaborate what the issue is with using
this_cpu_read()? It too is safe to use when interrupts are disabled.

>
> Signed-off-by: Hui Su <suhui@...u.com>
> ---
>   arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
> index 2207916cae65..f0cc0a89333b 100644
> --- a/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
> +++ b/arch/x86/kernel/cpu/resctrl/pseudo_lock.c
> @@ -464,8 +464,8 @@ static int pseudo_lock_fn(void *_rdtgrp)
>        * cache.
>        */
>       __wrmsr(MSR_MISC_FEATURE_CONTROL, prefetch_disable_bits, 0x0);
> -     closid_p = this_cpu_read(pqr_state.cur_closid);
> -     rmid_p = this_cpu_read(pqr_state.cur_rmid);
> +     closid_p = __this_cpu_read(pqr_state.cur_closid);
> +     rmid_p = __this_cpu_read(pqr_state.cur_rmid);
>       mem_r = plr->kmem;
>       size = plr->size;
>       line_size = plr->line_size;
>

Reinette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ