From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CBDFC47080 for ; Tue, 1 Jun 2021 10:04:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5CFAE6139A for ; Tue, 1 Jun 2021 10:04:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231219AbhFAKFz (ORCPT ); Tue, 1 Jun 2021 06:05:55 -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-Google-Smtp-Source: ABdhPJyYvzLvMWBYADhPC/L0sXKCXJvS8ohDR7Nup1uzs/b/Drk5b6HBrF9cjFYdo3UFMg01jNr5r88J/cOJEYDuDVQ= 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.