From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751806AbdHXKvG (ORCPT ); Thu, 24 Aug 2017 06:51:06 -0400 Received: from ozlabs.org ([103.22.144.67]:34765 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751292AbdHXKvF (ORCPT ); Thu, 24 Aug 2017 06:51:05 -0400 From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 4/4] powerpc/32: remove a NOP from memset() In-Reply-To: References: User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Thu, 24 Aug 2017 20:51:03 +1000 Message-ID: <871so1w86g.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > memset() is patched after initialisation to activate the > optimised part which uses cache instructions. > > Today we have a 'b 2f' to skip the optimised patch, which then gets > replaced by a NOP, implying a useless cycle consumption. > As we have a 'bne 2f' just before, we could use that instruction > for the live patching, hence removing the need to have a > dedicated 'b 2f' to be replaced by a NOP. > > This patch changes the 'bne 2f' by a 'b 2f'. During init, that > 'b 2f' is then replaced by 'bne 2f' I'm not sure what the sequence is during boot for the 32-bit code, but can you use an ALT_FTR section for this? Possibly that doesn't get done at the right time though. cheers