From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760184AbcLARIZ (ORCPT ); Thu, 1 Dec 2016 12:08:25 -0500 Received: from mail-vk0-f54.google.com ([209.85.213.54]:36844 "EHLO mail-vk0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753679AbcLARIX (ORCPT ); Thu, 1 Dec 2016 12:08:23 -0500 MIME-Version: 1.0 In-Reply-To: <20161201092228.calajwwv4k4k4l6f@pd.tnic> References: <46816abe4f68ac3eb9b80231bf64ba8edcebc2f7.1480536936.git.luto@kernel.org> <20161201092228.calajwwv4k4k4l6f@pd.tnic> From: Andy Lutomirski Date: Thu, 1 Dec 2016 09:08:01 -0800 Message-ID: Subject: Re: [PATCH 4/4] x86/asm: Change sync_core() to use MOV to CR2 to serialize To: Borislav Petkov , Jan Beulich , Andrew Cooper Cc: Andy Lutomirski , X86 ML , One Thousand Gnomes , "linux-kernel@vger.kernel.org" , Brian Gerst , Matthew Whitehead , Henrique de Moraes Holschuh Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 1, 2016 at 1:22 AM, Borislav Petkov wrote: > On Wed, Nov 30, 2016 at 12:34:55PM -0800, Andy Lutomirski wrote: >> Aside from being excessively slow, CPUID is problematic: Linux runs >> on a handful of CPUs that don't have CPUID. MOV to CR2 is always >> available, so use it instead. >> >> Signed-off-by: Andy Lutomirski >> --- >> arch/x86/include/asm/processor.h | 31 ++++++++----------------------- >> 1 file changed, 8 insertions(+), 23 deletions(-) > > Looks nice. > > I'm wondering if we should leave this one in tip for an additional cycle > to have it tested on more hw. I know, it is architectural and so on but > who knows what every implementation actually does... I want the Xen opinion as well. Xen folks, can Linux use write_cr2 to serialize the CPU core on Xen PV or do we need something a bit heavier weight like native_write_cr2? --Andy