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: <alpine.DEB.2.00.1101140846560.2423@router.home>
Date:	Fri, 14 Jan 2011 08:50:23 -0600 (CST)
From:	Christoph Lameter <cl@...ux.com>
To:	Yinghai Lu <yinghai@...nel.org>
cc:	Greg KH <greg@...ah.com>,
	Jason Wessel <jason.wessel@...driver.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	Jesse Barnes <jbarnes@...tuousgeek.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Tejun Heo <tj@...nel.org>
Subject: Re: [RFC PATCH] x86: Add safe_udelay() and safe_msleep()

On Thu, 13 Jan 2011, Yinghai Lu wrote:

> from code review, we should not use udelay() that early.
>
> in arch/x86/lib/delay.c we have
> inline void __const_udelay(unsigned long xloops)
> {
>         int d0;
>
>         xloops *= 4;
>         asm("mull %%edx"
>                 :"=d" (xloops), "=&a" (d0)
>                 :"1" (xloops), "0"
>                 (this_cpu_read(cpu_info.loops_per_jiffy) * (HZ/4)));

^^^^ this line was recently changed through the commit included at the end
of the message. Solution would be to revert the commit or set the
loops_per_jiffy in the early per cpu segment (as done in the last patch I
saw from you).

commit 357089fca91f639dd005ae0721f5f932b4f276ab
Author: Christoph Lameter <cl@...ux.com>
Date:   Thu Dec 16 12:14:43 2010 -0600

    x86: udelay: Use this_cpu_read to avoid address calculation

    The code will use a segment prefix instead of doing the lookup and
    calculation.

    Signed-off-by: Christoph Lameter <cl@...ux.com>
    Acked-by: "H. Peter Anvin" <hpa@...or.com>
    Signed-off-by: Tejun Heo <tj@...nel.org>

diff --git a/arch/x86/lib/delay.c b/arch/x86/lib/delay.c
index ff485d3..fc45ba8 100644
--- a/arch/x86/lib/delay.c
+++ b/arch/x86/lib/delay.c
@@ -121,7 +121,7 @@ inline void __const_udelay(unsigned long xloops)
        asm("mull %%edx"
                :"=d" (xloops), "=&a" (d0)
                :"1" (xloops), "0"
-               (cpu_data(raw_smp_processor_id()).loops_per_jiffy *
(HZ/4)));
+               (this_cpu_read(cpu_info.loops_per_jiffy) * (HZ/4)));

        __delay(++xloops);
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ