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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 24 Jan 2018 17:20:30 +0000
From:   "Sun, Ning" <ning.sun@...el.com>
To:     Jia-Ju Bai <baijiaju1990@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>
CC:     "mingo@...hat.com" <mingo@...hat.com>,
        "hpa@...or.com" <hpa@...or.com>, "x86@...nel.org" <x86@...nel.org>,
        "tboot-devel@...ts.sourceforge.net" 
        <tboot-devel@...ts.sourceforge.net>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] kernel: x86: tboot: Replace mdelay with usleep_range in
 tboot_wait_for_aps

It looks like tboot_wait_for_aps(...) is not called in atomic context .

mdelay(1) delays exactly 1msecs, I understand udelay(...) may not be  appropriate, as it is used for delay around 20usecs.
In terms of reducing busy wait, how can we determine the range in usleep_range(...) is 1000 to 2000, not from 20 to 1000?

Thanks,
-ning 


-----Original Message-----
From: Jia-Ju Bai [mailto:baijiaju1990@...il.com] 
Sent: Wednesday, January 24, 2018 5:38 AM
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Sun, Ning <ning.sun@...el.com>; mingo@...hat.com; hpa@...or.com; x86@...nel.org; tboot-devel@...ts.sourceforge.net; linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kernel: x86: tboot: Replace mdelay with usleep_range in tboot_wait_for_aps


On 2018/1/24 19:47, Thomas Gleixner wrote:
> On Wed, 24 Jan 2018, Jia-Ju Bai wrote:
>
>> The function tboot_wait_for_aps is not called in atomic context.
>> Thus mdelay can be replaced with usleep_range, to reduce busy wait.
> And how did you establish that it's not called in atomic context?
>
> Thanks,
>
> 	tglx

It is reported by a static analysis tool written by myself.
This tool finds that mdelay in tboot_wait_for_aps is not called by holding a spinlock or in an interrupt handler, thus mdelay can be replaced.


Thanks,
Jia-Ju Bai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ