Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3340464pxj; Tue, 1 Jun 2021 03:05:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxefqmvbgKEcyUakZlix/geO0OiRYV+J08jN0QtKQ8siqReAtpiXqDWalIY3CoBFWdZmvJq X-Received: by 2002:aa7:dc51:: with SMTP id g17mr23194664edu.43.1622541934973; Tue, 01 Jun 2021 03:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622541934; cv=none; d=google.com; s=arc-20160816; b=LH2IkcqEiXfxZ1RBjq7ZuZHAGnAlJzYIfm9jHKzLpSxMm1x00WWAm8u93YKGL0stPp TAlEkrzyymJrKMJ2xxOzsPxZvSw9FV1ZvvRhh3Abs5w3lnmRPoqztyPTUgK5fQkLWOUR 0CwFKoDgg1nUHDroj5nChLkdYKNl4ij9hvQ6FLL/e94wN2RyiicLxaQX5Mt/9JCwqcmO dFQFJixF6Lsdzwhwv/NxuMYzM6BheUHdIddU3Qij4PVvCXxuqpLruQGVTSBSPWkzGneJ kXUpKISQ1fiYWCfDDby7mqe6whe+flnV7UxW6r7mZ97zXqLFDLHMpLRbvRGQuOwomrmi MSYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Oylw+Cwde46yrkq9NbXmlDzaZbfHtwoW7NFHCFszY60=; b=maiYji5UH8XAst1+Hi0Zxy0bX5PgPIjP8BFzEdHr1MA6lDFTXWNWpxbpUlI+2AJ8oY sHAwEFS0LE3MvaBZ/GlajsOl67yPQTUg5L8Rdl215JT2lJEGIZW32LMOoYlFjlUZfMae 62W7sFH801OxrsMLdsa2GV07nDeeYrMdr4BxCCRUgMESeRUeKJaqVSWeY5ljuvYDRCyQ uh4B8Ta6xkMtTajl72QTjSpYOZt29W2dqgNYeSPYtJY/nsDHutzVZz1U5fT4oSU0vknF WMSm4yzObDij7ALPFTIsyrfXDJ3KdkVHfTKtL898Au7GPsnlqhB77lTYDknJ5QGLNUyH IGVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o+Ja0NgN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v6si16568820edc.364.2021.06.01.03.05.11; Tue, 01 Jun 2021 03:05:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o+Ja0NgN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230288AbhFAKFy (ORCPT + 99 others); Tue, 1 Jun 2021 06:05:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbhFAKFx (ORCPT ); Tue, 1 Jun 2021 06:05:53 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8F28C061574 for ; Tue, 1 Jun 2021 03:04:10 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id z17so13640743wrq.7 for ; Tue, 01 Jun 2021 03:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Oylw+Cwde46yrkq9NbXmlDzaZbfHtwoW7NFHCFszY60=; b=o+Ja0NgNlHYuajilaIbSEtRR7d/nAvRXGfyG4FMvl5j8sxaPg/qZbfhF/SAZyH2J/v oGzwLPEAtrUkj6nRGMHwn4uBlYxzmGZGK9Kvx+tOM2TjK/3kgjRiWHMFvziXpAFPICCe LJGljw02N3SJgP2BwOaRdoK7lbDahiRvHO9zPTfKSg++qZvwbc9qAUQtibMGAmFi2ur7 B4SNbRpkMSAAq12uBecd1BPN0cJBZw/fDQbRPW5Fc4F2ONZ04a9eLK9jmYXwA4heiM3k fLUcnV0LSIPlNPcMPYcyMskOFD9z2cSyGq5rziCG2XmW1o8EA1RLeQ2BVgWnGAqmUGsr gq9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Oylw+Cwde46yrkq9NbXmlDzaZbfHtwoW7NFHCFszY60=; b=Mhz/jW0NsIBUsjsX1A+U8Xja6SI0xYPQJPbKfz2JNoMKH63oKgoFDigGmuBuyhsbxt 5RDPvJOtf+dXeYS26iKl4I4G1fcCWt+FoH30K51V3p1x2wXLnZCR/drLVAtWxf7tRmVc S0n6XX4HzKsb3gnuwp1BMzTmqYK0nQMG02PLx3E7ZJOeIzD8hQN4EVOxVSUePjhkQP2D s4chbIAnRJ+wBamHH7NHuhqiyUqfkUpZU7WMAw23WxYtTdkp959qNMLKFE8ZiJO0OYs/ dx7qIZV7SIcoylkQ4ybpKJG7bejZz1BPWHTOzLgFgxeyRMaqRTlbgi0g3+DlSOTMFRix vT7A== X-Gm-Message-State: AOAM533EbY51Zq7n6+oG797HbJ4DUMIs5J2eDBUfHvhdaqVAfezwgYNW jDXJlGWliEoizcEtyXxeXUPceSuHqllFN4Z2F0Y= X-Received: by 2002:a5d:4744:: with SMTP id o4mr26280927wrs.86.1622541849435; Tue, 01 Jun 2021 03:04:09 -0700 (PDT) MIME-Version: 1.0 References: <20200914150958.2200-1-oli.swede@arm.com> <20200914150958.2200-9-oli.swede@arm.com> In-Reply-To: <20200914150958.2200-9-oli.swede@arm.com> From: Sunil Kovvuri Date: Tue, 1 Jun 2021 15:33:58 +0530 Message-ID: Subject: Re: [PATCH v5 08/14] arm64: Import latest optimization of memcpy To: Oliver Swede Cc: Catalin Marinas , will@kernel.org, Robin Murphy , linux-arm-kernel@lists.indradead.org, LKML , Sunil Goutham , George Cherian Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 14, 2020 at 8:44 PM Oliver Swede wrote: > > From: Sam Tebbs > > Import the latest memcpy implementation into memcpy, > copy_{from, to and in}_user. > The implementation of the user routines is separated into two forms: > one for when UAO is enabled and one for when UAO is disabled, with > the two being chosen between with a runtime patch. > This avoids executing the many NOPs emitted when UAO is disabled. > > The project containing optimized implementations for various library > functions has now been renamed from 'cortex-strings' to > 'optimized-routines', and the new upstream source is > string/aarch64/memcpy.S as of commit 4c175c8be12 in > https://github.com/ARM-software/optimized-routines. > > Signed-off-by: Sam Tebbs > [ rm: add UAO fixups, streamline copy_exit paths, expand commit message ] > Signed-off-by: Robin Murphy > [ os: import newer memcpy algorithm, update commit message ] > Signed-off-by: Oliver Swede > --- > arch/arm64/include/asm/alternative.h | 36 --- > arch/arm64/lib/copy_from_user.S | 113 ++++++-- > arch/arm64/lib/copy_in_user.S | 129 +++++++-- > arch/arm64/lib/copy_template.S | 375 +++++++++++++++------------ > arch/arm64/lib/copy_template_user.S | 24 ++ > arch/arm64/lib/copy_to_user.S | 112 ++++++-- > arch/arm64/lib/copy_user_fixup.S | 14 + > arch/arm64/lib/memcpy.S | 47 ++-- > 8 files changed, 557 insertions(+), 293 deletions(-) > create mode 100644 arch/arm64/lib/copy_template_user.S > create mode 100644 arch/arm64/lib/copy_user_fixup.S Do you have any performance data with this patch ? I see these patches are still not pushed to mainline, any reasons ? Also curious to know why 128bit registers are not considered, similar to https://android.googlesource.com/platform/bionic.git/+/a71b4c3f144a516826e8ac5b262099b920c49ce0/libc/arch-arm64/generic-neon/bionic/memcpy.S Thanks, Sunil.