Received: by 10.223.148.5 with SMTP id 5csp7698619wrq; Thu, 18 Jan 2018 08:29:46 -0800 (PST) X-Google-Smtp-Source: ACJfBovQQW542BdhdKM04KpU+zsPforRGn++4C8RyBOkaj7Qjiv9C41oys3QMd9ILIsBq/jScdFx X-Received: by 10.99.67.133 with SMTP id q127mr30250016pga.365.1516292986485; Thu, 18 Jan 2018 08:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516292986; cv=none; d=google.com; s=arc-20160816; b=O+xQEH09B1aGx37XCMECA2ZIhSlgemP0myleMIxtjizqFQ0+OH2Ka2/qHYjOHuTLsB YB3TQJ8ZE4h2IoeWVoC3HwvE3OUdxYmndrsc9AKTQ9sKJGrOlDSAw9rQosv/IauXmgvH siYR9SjJblWlqDlHCYPdJWikjKCFOIEo+Sj4ZuVlOyFAh2KUbVJbswGPK7XX/e7AXYMe iNJHIoOG1tBz5vMA6Tfi2VToFpF8OW78jO+ckNHq5Xl8cxjixQYEMuq6jva/uq2THK2K b7ygvkPQLfOinj5rEWACE68pSG7Q6YtDU1XgjYmbsj9b7jboXfiBfNG52y/eM3rRKHZc geDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature :arc-authentication-results; bh=Y7DTgaP6T2CXSU3utq8eVBvjt0pxh/0uLv3M6kDseys=; b=Z1SAxtL4NaJLKtQfuz1XAe8nkiAWSOe3cl9r+HCo1F+FvCC1VzwAbEerC6Ro8vBmMR zx0h7iFTfSNX5hYKV6I4Ed5n47HNIgg8WECAa4ThNdRe/uUr0ga47dZvhAz6RjtRd+/w r+k9TDaFh0sFGfz0MOaOxBMBp0RKx0hZ2hcXHZ+IIg4MKyMHV/SSdRi9v0e+rHNiCMWR XaDV6kVmFhXrx1pBGmctgyFlXWpJtVfH86wdSxhRMhAHca9sXGaGjEA1xEe40zlqrBqw 2XqR1NepRUQXDKo+bXIe2+Gb1lrN9yZMb/NquCUi8hzPWk247J4o0gvdRCrcot6Zm7sO bzzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=G6CokSPz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si6275109pgd.45.2018.01.18.08.29.32; Thu, 18 Jan 2018 08:29:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=G6CokSPz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933175AbeARQGK (ORCPT + 99 others); Thu, 18 Jan 2018 11:06:10 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:40084 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933097AbeARQFz (ORCPT ); Thu, 18 Jan 2018 11:05:55 -0500 Received: by mail-pg0-f68.google.com with SMTP id g16so7984630pgn.7 for ; Thu, 18 Jan 2018 08:05:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=Y7DTgaP6T2CXSU3utq8eVBvjt0pxh/0uLv3M6kDseys=; b=G6CokSPzQ8CKmFhjnvRg4NSVAazvhe6+P+KgnNAtPepJPkFlZvdHmP0zyiPxE0algi nODezfd7AZ5sppUyvOt21zvMBqOF3wVmx/OaL2P7mb0svHsOeKRLiu82xlelfbcDpRGR +Zi7OpnT64OFYHmI/NUt04ETkZSYuqu98Cjo3m8wCBl8u5jJns7e+tJ1OQk9hD36mBka +0FgiXdZtwaJOh1ghwE7xWSu92k00jgc23jEjMIUsiJsycxANoYe81V/rABFbpQhqgcA MTtBp/aC9+44Vyv9S9TnFo+qJE6GI+cBxi1WYHGsM3TpnGzAa0KR8GUHMRWQlHLz+4Pm REhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=Y7DTgaP6T2CXSU3utq8eVBvjt0pxh/0uLv3M6kDseys=; b=mqY2/0EXvSbBnhJedTyrxHFnTVh/GPlmFBSZH43jO2nBmWvpYmszUp8mspFwUfIGFN +nj9rbJ/WBHClpluJlLg41joLWjv31qk04u28pSdKruzrh4zbZcMxeiAY2CIISNveWRw KL1qi9wAwRGc5TSQ13SXBvTb6EHFcovd59Y19dXkDoBOe5YWSom9gNWTkh3iocq3U4ue in0plJm7a8vfiM6DAKFavESYvWm31FbQEbcRhv4KbfEPwNsS1qJ+6Fl2Ke8eo+GAqkSJ AgnfE+VD6yYVl8vI6K1VK5bql+QryUc/l7jpjXqB9e4I7g7ze3ALGAA6jNJ5iYBnlFVw TwWA== X-Gm-Message-State: AKwxytceDe8SsmaO1eCk2UqlhgT7fj3fm6YAzGMOpyxXpqsCECUD5LKp aFCLCnS6xVa1KU4o4ks9H+qrJQ== X-Received: by 2002:a17:902:48c8:: with SMTP id u8-v6mr6631plh.272.1516291554501; Thu, 18 Jan 2018 08:05:54 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id n7sm974854pgd.10.2018.01.18.08.05.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 08:05:54 -0800 (PST) Date: Thu, 18 Jan 2018 08:05:54 -0800 (PST) X-Google-Original-Date: Thu, 18 Jan 2018 08:05:33 PST (-0800) Subject: Re: [PATCH] MIPS: use generic GCC library routines from lib/ In-Reply-To: <20180117163418.ba77b2f72298092fb843fda7@gmail.com> CC: matt.redfearn@mips.com, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, ralf@linux-mips.org From: Palmer Dabbelt To: antonynpavlov@gmail.com Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 17 Jan 2018 05:34:18 PST (-0800), antonynpavlov@gmail.com wrote: > On Wed, 17 Jan 2018 09:03:48 +0000 > Matt Redfearn wrote: > >> Hi, >> >> On Wed, Jan 17, 2018 at 09:51:21AM +0300, Antony Pavlov wrote: >> > The commit b35cd9884fa5 ("lib: Add shared copies of >> > some GCC library routines") makes it possible >> > to share generic GCC library routines by several >> > architectures. >> > >> > This commit removes several generic GCC library >> > routines from arch/mips/lib/ in favour of similar >> > routines from lib/. >> > >> > Signed-off-by: Antony Pavlov >> > Cc: Palmer Dabbelt >> > Cc: Ralf Baechle >> > Cc: linux-mips@linux-mips.org >> > Cc: linux-kernel@vger.kernel.org >> > --- >> > arch/mips/Kconfig | 5 +++++ >> > arch/mips/lib/Makefile | 2 +- >> > arch/mips/lib/ashldi3.c | 30 ------------------------------ >> > arch/mips/lib/ashrdi3.c | 32 -------------------------------- >> > arch/mips/lib/cmpdi2.c | 28 ---------------------------- >> > arch/mips/lib/lshrdi3.c | 30 ------------------------------ >> > arch/mips/lib/ucmpdi2.c | 22 ---------------------- >> > 7 files changed, 6 insertions(+), 143 deletions(-) >> > delete mode 100644 arch/mips/lib/ashldi3.c >> > delete mode 100644 arch/mips/lib/ashrdi3.c >> > delete mode 100644 arch/mips/lib/cmpdi2.c >> > delete mode 100644 arch/mips/lib/lshrdi3.c >> > delete mode 100644 arch/mips/lib/ucmpdi2.c >> > >> > diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig >> > index 350a990fc719..9cd49ee848c6 100644 >> > --- a/arch/mips/Kconfig >> > +++ b/arch/mips/Kconfig >> > @@ -73,6 +73,11 @@ config MIPS >> > select RTC_LIB if !MACH_LOONGSON64 >> > select SYSCTL_EXCEPTION_TRACE >> > select VIRT_TO_BUS >> > + select GENERIC_ASHLDI3 >> > + select GENERIC_ASHRDI3 >> > + select GENERIC_LSHRDI3 >> > + select GENERIC_CMPDI2 >> > + select GENERIC_UCMPDI2 >> >> Please preserve alphabetical order > > Ok, I'll fix order in v2 patch. > >> > --- a/arch/mips/lib/ucmpdi2.c >> > +++ /dev/null >> > @@ -1,22 +0,0 @@ >> > -// SPDX-License-Identifier: GPL-2.0 >> > -#include >> > - >> > -#include "libgcc.h" >> > - >> > -word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b) >> >> The version of __ucmpdi2 in /lib/ is not marked notrace. We have seen >> issues before with compiler intrinsics not being marked notrace - see >> aedcfbe06558 ("MIPS: lib: Mark intrinsics notrace") >> >> Please ensure that the /lib/ version is equivalent before switching to >> that version. > > Good shot! I have missed this 'notrace'. > > lib/ucmpdi2.c differ from other GCC library routines files from lib > related to my patch (ashldi3.c, ashrdi3.c, cmpdi2.c, lshrdi3.c): > only lib/ucmpdi2.c has no 'notrace' flag. In other details the files > look equivalent. The files arch/mips/lib/libgcc.h and include/linux/libgcc.h > have no fundamental differences. > > to Palmer: > Can we add notrace to lib/ucmpdi2.c? Works for me. Do you want to add a patch to this set? Since it's a dependency of this patch it seems to make a bit more sense to just keep here. Mine looks like commit dba01764391cbd6e636595f7b957357b2cf2c14a Author: Palmer Dabbelt Date: Thu Jan 18 07:47:35 2018 -0800 Add notrace to lib/ucmpdi2.c As part of the MIPS conversion to use the generic GCC library routines, Matt Redfearn discovered that I'd missed a notrace on __ucmpdi2(). This patch rectifies the problem. CC: Matt Redfearn CC: Antony Pavlov Signed-off-by: Palmer Dabbelt diff --git a/lib/ucmpdi2.c b/lib/ucmpdi2.c index 25ca2d4c1e19..597998169a96 100644 --- a/lib/ucmpdi2.c +++ b/lib/ucmpdi2.c @@ -17,7 +17,7 @@ #include #include -word_type __ucmpdi2(unsigned long long a, unsigned long long b) +word_type notrace __ucmpdi2(unsigned long long a, unsigned long long b) { const DWunion au = {.ll = a}; const DWunion bu = {.ll = b}; > It looks like that nobody (even RISC-V code) > uses GENERIC_CMPDI2 and GENERIC_UCMPDI2. Why? > Do you use them in your local branches? I'd meant to convert every arch port over to using the generic routines, but it sort of just got lost in the shuffle. I'll resurrect that patch set.