From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933633AbcAYS71 (ORCPT ); Mon, 25 Jan 2016 13:59:27 -0500 Received: from mail.skyhub.de ([78.46.96.112]:36637 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933383AbcAYS7Z (ORCPT ); Mon, 25 Jan 2016 13:59:25 -0500 Date: Mon, 25 Jan 2016 19:58:50 +0100 From: Borislav Petkov To: Andy Lutomirski Cc: "H. Peter Anvin" , Brian Gerst , X86 ML , LKML Subject: Re: [PATCH 6/6] x86/vdso: Use static_cpu_has() Message-ID: <20160125185850.GD14030@pd.tnic> References: <1453627728-27197-1-git-send-email-bp@alien8.de> <1453627728-27197-7-git-send-email-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We discussed this on IRC, here's the gist: On Mon, Jan 25, 2016 at 10:45:30AM -0800, Andy Lutomirski wrote: > On Sun, Jan 24, 2016 at 1:28 AM, Borislav Petkov wrote: > > From: Borislav Petkov > > > > ... and simplify and speed up a tad. > > This function is only used when initializing CPUs, so the "tad" is > very small indeed. ... except it'll pay out when the branch is patched in. Considering that the majority of the modern CPUs out there - BSP and APs :-) - have RDTSCP, this check will turn into a 5-byte NOP which is the most optimal we can get. Yeah, it is still an init path so called once on each CPU but still. > If there are systems for which some cpus support rdtscp and some > don't, then this patch is wrong. Of course, if the bsp has rdtscp and > the aps don't, then we're screwed anyway. That would be a very odd case. > I left it as cpu_has because this is a cpu init function and it seemed > reasonable. Yeah, I see what you mean. But it costs us only the patching and after that we win from not needing for fetch boot_cpu_data anymore on the APs coming up. Not a panties-dropper speedup but I still think it is worth the trouble. > That being said, I have no meaningful objection to this patch. Thanks. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.