Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933510Ab2K3R2J (ORCPT ); Fri, 30 Nov 2012 12:28:09 -0500 Received: from mail.skyhub.de ([78.46.96.112]:42134 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757230Ab2K3R2H (ORCPT ); Fri, 30 Nov 2012 12:28:07 -0500 Date: Fri, 30 Nov 2012 18:28:04 +0100 From: Borislav Petkov To: Linus Torvalds Cc: "H. Peter Anvin" , "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , Linux Kernel Mailing List , Mario Gzuk Subject: Re: [PATCH 8/8] x86, cleanups: Simplify sync_core() in the case of no CPUID Message-ID: <20121130172804.GC23034@liondog.tnic> Mail-Followup-To: Borislav Petkov , Linus Torvalds , "H. Peter Anvin" , "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , Linux Kernel Mailing List , Mario Gzuk References: <1354132230-21854-1-git-send-email-hpa@linux.intel.com> <1354132230-21854-9-git-send-email-hpa@linux.intel.com> <20121128204158.GC14635@liondog.tnic> <50B7D28A.4000401@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1299 Lines: 33 On Fri, Nov 30, 2012 at 09:01:50AM -0800, Linus Torvalds wrote: > Hmm. The virtualization issue brings up another point: do we *really* > want to use cpuid for serialization at all? > > Exactly because under _real_ virtualization (as opposed to para-virt), > it can cause unnecessary exits in a virtualized environment, no? Well, in that case the function performs as advertized although it is a very expensive serialization for virt. And virt guys hate exits. > So I'm wondering if there is any better synchronizing instruction.. > > I guess sync_core() isn't used *that* much, so maybe we don't care, > but I thought I'd ask... Well, we use it in alternatives, MCE, intel_early_init, Intel ucode, ftrace, and SGI's GRU thing. >From all of the above, the alternatives case is kinda relevant for virt where we do text_poke_early in a loop for every alternative section so this could pile up to a bunch of vmexits depending on the emulated hardware. Might be worth a replacement if it is noticeable in guests. Hmm... -- Regards/Gruss, Boris. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/