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-next>] [day] [month] [year] [list]
Date:   Wed, 24 Jan 2018 09:58:22 +0800
From:   Jia-Ju Bai <baijiaju1990@...il.com>
To:     ning.sun@...el.com, tglx@...utronix.de, mingo@...hat.com,
        hpa@...or.com
Cc:     x86@...nel.org, tboot-devel@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org, Jia-Ju Bai <baijiaju1990@...il.com>
Subject: [PATCH] kernel: x86: tboot: Replace mdelay with usleep_range in tboot_wait_for_aps

The function tboot_wait_for_aps is not called in atomic context.
Thus mdelay can be replaced with usleep_range, to reduce busy wait.

Signed-off-by: Jia-Ju Bai <baijiaju1990@...il.com>
---
 arch/x86/kernel/tboot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
index a4eb279..c1d523e 100644
--- a/arch/x86/kernel/tboot.c
+++ b/arch/x86/kernel/tboot.c
@@ -317,7 +317,7 @@ static int tboot_wait_for_aps(int num_aps)
 	timeout = AP_WAIT_TIMEOUT*HZ;
 	while (atomic_read((atomic_t *)&tboot->num_in_wfs) != num_aps &&
 	       timeout) {
-		mdelay(1);
+		usleep_range(1000, 2000);
 		timeout--;
 	}
 
-- 
1.7.9.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ