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: <YD4B2TG7JPqFChhR@hirez.programming.kicks-ass.net>
Date:   Tue, 2 Mar 2021 10:14:01 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Feng Tang <feng.tang@...el.com>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, H Peter Anvin <hpa@...or.com>,
        Borislav Petkov <bp@...en8.de>, x86@...nel.org,
        linux-kernel@...r.kernel.org, rui.zhang@...el.com,
        dave.hansen@...el.com, andi.kleen@...el.com, len.brown@...el.com
Subject: Re: [PATCH] x86/tsc: mark tsc reliable for qualified platforms

On Tue, Mar 02, 2021 at 10:52:52AM +0800, Feng Tang wrote:
> @@ -1193,6 +1193,17 @@ static void __init check_system_tsc_reliable(void)
>  #endif
>  	if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE))
>  		tsc_clocksource_reliable = 1;
> +
> +	/*
> +	 * Ideally the socket number should be checked, but this is called
> +	 * by tsc_init() which is in early boot phase and the socket numbers
> +	 * may not be available. Use 'nr_online_nodes' as a fallback solution
> +	 */
> +	if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC)
> +		&& boot_cpu_has(X86_FEATURE_NONSTOP_TSC)
> +		&& boot_cpu_has(X86_FEATURE_TSC_ADJUST)
> +		&& nr_online_nodes <= 2)
> +		tsc_clocksource_reliable = 1;

Logical operators go at the end of a line and alignment is with the (,
not the code block after it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ