From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753815AbbCEAeZ (ORCPT ); Wed, 4 Mar 2015 19:34:25 -0500 Received: from mail-wg0-f42.google.com ([74.125.82.42]:40526 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753769AbbCEAeW (ORCPT ); Wed, 4 Mar 2015 19:34:22 -0500 Date: Thu, 5 Mar 2015 01:34:17 +0100 From: Ingo Molnar To: Borislav Petkov Cc: X86 ML , Andy Lutomirski , LKML , Linus Torvalds Subject: Re: [PATCH v2 07/15] x86/lib/copy_user_64.S: Convert to ALTERNATIVE_2 Message-ID: <20150305003417.GC20449@gmail.com> References: <1424776497-3180-1-git-send-email-bp@alien8.de> <1424776497-3180-8-git-send-email-bp@alien8.de> <20150304062552.GA16111@gmail.com> <20150304071324.GA22028@gmail.com> <20150304090626.GC3233@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150304090626.GC3233@pd.tnic> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Borislav Petkov wrote: > On Wed, Mar 04, 2015 at 08:13:24AM +0100, Ingo Molnar wrote: > > Btw., the x86 memset() variants are using this today, and I think this > > is the most optimal jump-patching variant, even if it means a small > > amount of code duplication between the copy_user variants. > > Yeah, the problem with that one was that we patch a huge amount of code, > see the dump below. > > The X86_FEATURE_REP_GOOD thing replaces a 172 bytes memset with the > 42 byte REP;STOSQ version and the X86_FEATURE_ERMS does the same > with REP;STOSB. So I'd not patch in the large _orig variant, it's legacy mostly - but the two fast variants? Thanks, Ingo