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: <SJ1PR84MB30446EC71AAC4B36B00CFEC8E7D29@SJ1PR84MB3044.NAMPRD84.PROD.OUTLOOK.COM>
Date:   Sat, 21 May 2022 18:50:34 +0000
From:   "Travis, Mike" <mike.travis@....com>
To:     Hans de Goede <hdegoede@...hat.com>,
        Borislav Petkov <bp@...en8.de>,
        "Dave Hansen" <dave.hansen@...ux.intel.com>,
        Ingo Molnar <mingo@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        "Wahl, Steve" <steve.wahl@....com>,
        "x86@...nel.org" <x86@...nel.org>
CC:     "Sivanich, Dimitri" <dimitri.sivanich@....com>,
        Andy Shevchenko <andy@...radead.org>,
        Darren Hart <dvhart@...radead.org>,
        "H. Peter Anvin" <hpa@...or.com>,
        "Anderson, Russ" <russ.anderson@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "platform-driver-x86@...r.kernel.org" 
        <platform-driver-x86@...r.kernel.org>,
        "Travis, Mike" <mike.travis@....com>
Subject: Re: [PATCH] x86/platform/uv: Dont use smp_processor_id while
 preemptable

Thanks, I'll do that.

________________________________________
From: Hans de Goede <hdegoede@...hat.com>
Sent: Saturday, May 21, 2022 6:57 AM
To: Travis, Mike; Borislav Petkov; Dave Hansen; Ingo Molnar; Thomas Gleixner; Wahl, Steve; x86@...nel.org
Cc: Sivanich, Dimitri; Andy Shevchenko; Darren Hart; H. Peter Anvin; Anderson, Russ; linux-kernel@...r.kernel.org; platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH] x86/platform/uv: Dont use smp_processor_id while preemptable

Hi Mike,

On 5/20/22 22:37, Mike Travis wrote:
> To avoid a "BUG: using smp_processor_id() in preemptible" debug
> warning message, disable preemption around use of the processor id.
>
> Signed-off-by: Mike Travis <mike.travis@....com>
> Reviewed-by: Steve Wahl <steve.wahl@....com>
> Reviewed-by: Dimitri Sivanich <dimitri.sivanich@....com>

A git blame shows that this code has been around for quite
a while; so presumably this should be backported to some of
the stable kernel series ?

Maybe add an appropriate Cc: stable tag with the range of
kernels this should be added to and/or add a Fixes: tag?

Regards,

Hans


> ---
>  arch/x86/platform/uv/uv_time.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86/platform/uv/uv_time.c
> index 54663f3e00cb..094190814a28 100644
> --- a/arch/x86/platform/uv/uv_time.c
> +++ b/arch/x86/platform/uv/uv_time.c
> @@ -275,14 +275,17 @@ static int uv_rtc_unset_timer(int cpu, int force)
>   */
>  static u64 uv_read_rtc(struct clocksource *cs)
>  {
> -     unsigned long offset;
> +     unsigned long offset, time;
> +     unsigned int cpu = get_cpu();
>
>       if (uv_get_min_hub_revision_id() == 1)
>               offset = 0;
>       else
> -             offset = (uv_blade_processor_id() * L1_CACHE_BYTES) % PAGE_SIZE;
> +             offset = (uv_cpu_blade_processor_id(cpu) * L1_CACHE_BYTES) % PAGE_SIZE;
>
> -     return (u64)uv_read_local_mmr(UVH_RTC | offset);
> +     time = (u64)uv_read_local_mmr(UVH_RTC | offset);
> +     put_cpu();
> +     return time;
>  }
>
>  /*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ