From nobody Fri Sep 20 01:33:39 2024 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F83D196DB0; Wed, 5 Jun 2024 13:36:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717594573; cv=none; b=Z5voNG8e1jmyWtgP5Bbob5Ylp2hEHNddzOZLPhdhExtcdAK/WQuA9N5jgL2hnW3uVcwDpSi+eg0Qvy8lA2R6tGUoebP+BkMjvTlzRdFUy/pGuOnTAIj2l9pjRG6YvQZlt3dM9aj4FgbKbJM33P/RWCaHsj+j095TAAdt10pyV+o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717594573; c=relaxed/simple; bh=36NpWwXx8D6E47YyQKiLgOAahtbadz4JVG9fklkYBpU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=vEXvcL/1z0rzYEPj1L0o3dStoTYMlCDfu3pQ+Ofk+jVPEICsc5HL6EsSQGkKiQBXfMFYjy6C7FQaTsiORdmwvOsqQfhjHbBmmvngIsTFRrPSIOh6N0G5TeshTvm5ZBj4sgMGG5NiUndYiOPnQEJeK+q3H5fBBogTry8x9Q98QI8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.255 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4VvT061r96z1S9g8; Wed, 5 Jun 2024 21:32:06 +0800 (CST) Received: from dggpemm500005.china.huawei.com (unknown [7.185.36.74]) by mail.maildlp.com (Postfix) with ESMTPS id D97EA18007A; Wed, 5 Jun 2024 21:36:02 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 5 Jun 2024 21:36:02 +0800 From: Yunsheng Lin To: , , CC: , , Yunsheng Lin , Alexander Duyck , Max Filippov , Chris Zankel Subject: [PATCH net-next v6 02/15] xtensa: remove the get_order() implementation Date: Wed, 5 Jun 2024 21:32:52 +0800 Message-ID: <20240605133306.11272-3-linyunsheng@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240605133306.11272-1-linyunsheng@huawei.com> References: <20240605133306.11272-1-linyunsheng@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500005.china.huawei.com (7.185.36.74) Content-Type: text/plain; charset="utf-8" As the get_order() implemented by xtensa supporting 'nsau' instruction seems be the same as the generic implementation in include/asm-generic/getorder.h when size is not a constant value as the generic implementation calling the fls*() is also utilizing the 'nsau' instruction for xtensa. So remove the get_order() implemented by xtensa, as using the generic implementation may enable the compiler to do the computing when size is a constant value instead of runtime computing and enable the using of get_order() in BUILD_BUG_ON() macro. CC: Alexander Duyck Signed-off-by: Yunsheng Lin Acked-by: Max Filippov --- arch/xtensa/include/asm/page.h | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h index 4db56ef052d2..8665d57991dd 100644 --- a/arch/xtensa/include/asm/page.h +++ b/arch/xtensa/include/asm/page.h @@ -109,26 +109,8 @@ typedef struct page *pgtable_t; #define __pgd(x) ((pgd_t) { (x) } ) #define __pgprot(x) ((pgprot_t) { (x) } ) =20 -/* - * Pure 2^n version of get_order - * Use 'nsau' instructions if supported by the processor or the generic ve= rsion. - */ - -#if XCHAL_HAVE_NSA - -static inline __attribute_const__ int get_order(unsigned long size) -{ - int lz; - asm ("nsau %0, %1" : "=3Dr" (lz) : "r" ((size - 1) >> PAGE_SHIFT)); - return 32 - lz; -} - -#else - # include =20 -#endif - struct page; struct vm_area_struct; extern void clear_page(void *page); --=20 2.30.0