From patchwork Mon Oct 28 11:53:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunsheng Lin X-Patchwork-Id: 13853407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E031DD1359C for ; Mon, 28 Oct 2024 12:18:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6B7706B0083; Mon, 28 Oct 2024 08:18:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 667D76B0085; Mon, 28 Oct 2024 08:18:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 556CC6B0088; Mon, 28 Oct 2024 08:18:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 3A82D6B0083 for ; Mon, 28 Oct 2024 08:18:36 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B59ADA1F30 for ; Mon, 28 Oct 2024 12:17:54 +0000 (UTC) X-FDA: 82722913476.21.F0AA554 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf17.hostedemail.com (Postfix) with ESMTP id 3E9A040003 for ; Mon, 28 Oct 2024 12:18:14 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linyunsheng@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730117704; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WN+jut+L9OfbMgq+aHO24b1yK9gvcgZCCS02gTNvf5U=; b=EoE+ydbTf8SWSz3q/tkFfsyYeuAKlonVwac8PqXNVnJReqp54vbFw+7E4lHOQnak0Wo4va zzu/LhJwDAJSQykYxcVa7Z7QhYOq30MW7rlT6Zau1SR1v5hZtZB+wi26A+npQC/iShogJv DTXfnLkogfDlY9zEkVhlCad28mjhM28= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of linyunsheng@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linyunsheng@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730117704; a=rsa-sha256; cv=none; b=UWKDUvSZ5Lpz8/t/0sRrOViCzc5Mr3ws+06pkm8osTORUx43Tn/jkYnrQCqXypzEiXG3mS 22FFmegqWivcqv3BxSRsLmEbWozJ6bjdL9cG7JXQKU7GLjmOIRCQ+xRlTxCeOlu0l+BWMH Lj2tlVJpcESGIPL5HPi0yRho27mKuVg= Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4XcX2z0fVVzpWG7; Mon, 28 Oct 2024 19:58:19 +0800 (CST) Received: from dggpemf200006.china.huawei.com (unknown [7.185.36.61]) by mail.maildlp.com (Postfix) with ESMTPS id 115551800CF; Mon, 28 Oct 2024 20:00:15 +0800 (CST) Received: from localhost.localdomain (10.90.30.45) by dggpemf200006.china.huawei.com (7.185.36.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 28 Oct 2024 20:00:14 +0800 From: Yunsheng Lin To: , , CC: , , Yunsheng Lin , Alexander Duyck , Andrew Morton , Linux-MM , Max Filippov , Alexander Duyck , Chris Zankel Subject: [PATCH net-next v23 5/7] xtensa: remove the get_order() implementation Date: Mon, 28 Oct 2024 19:53:40 +0800 Message-ID: <20241028115343.3405838-6-linyunsheng@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20241028115343.3405838-1-linyunsheng@huawei.com> References: <20241028115343.3405838-1-linyunsheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.30.45] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemf200006.china.huawei.com (7.185.36.61) X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 3E9A040003 X-Stat-Signature: snst78x61mj5wdip18ixgugh71bw94ek X-Rspam-User: X-HE-Tag: 1730117894-169904 X-HE-Meta: U2FsdGVkX19U64SQdQHo1jWApIZ66XhqMtDV1i20hlGipNObDOUbMSH06V8L2+jh3jIJ7zQNZKMVuC8fBrPOKvsTRZ7Ng/e3FreYoHZQKI/+EEwEUWS49XSj6Ha4NAYUqSJOw+whCfvgKLIUcdbobuBGCgv5hunuVwlsubqTEevgJX6LEyZ8mgrxr0MMxgzZr+mzPVYeJw3fa6QTgGLDF1VVj7S7I1eaNf7L/YDGsMM/pcoZRz/e3d5Cp9OGM8PDRQHj3Z/PHONC+gDamjUqZJ0G86jAigzLleZqQy5ALnm9gG17RGkXy00Sgn7jyv86O7edIvWxkVlS0xck8bpTWzWf9JjCHmdcQnYtlfr4h5O54P4M0m2j4m4b5nn6plMvdyamAOwZOpXLvqnbwUbcxEUCrqNOVa7T5t2hSN7B5GsvbUnUqwdruQ12718bARcXsTpWMPFnCa3ShJdtkGXY85wwyhPj9b0Ld7BndDMMhG4pnyyoQEUw2O/4rMYSDYfc85Hj/xmqgRsuP1R3QFu5HplMjQcaFsyW0bJJZX795D46U9lMYaGhS34txjz2/PDpwn2Di3+NSvaRdaJidPHQvTGI+03mDdhlNgT2d14clz05MX1En4Ucg8w9op/H11iIUzg6/NDGJa+030I5GhivJd/Nw0a/yc3wjc/G3/x7A4rQPOJdX5qWxZFF6g3bXlxSKRRQANI4A7xJRgcGHA/aXcb9ddw6DCsDsbA6RfgNqi5IBtUgSuO79C7+SUpTlykFwnlKo6/sjxUfCkt6bju9XF4WgHiK5hbj1zk/QMwOQaIOvwNFw8/CLdCxccCyZT2N6/mJ3DDn2uihgytDrqOhttJPlVG1aG6zei3ElP9WShyF6H1VABLCjJrSUvYuG05rw5Kmx287Nx3wpmS6fadmIn+PYi2VO4adKEODyH8gwxTwKZloGLwzfvumXxGVdJLST6Ptb64XQ/zBA/YZNhO lfofJg8r ecZuS2YwxJIPmfoyeJ1gboX0Wc3Vo5vNlHwdw3LRm5M5rlfQjSZGJnkrVK9kMEmuUQMIKQpw1tu+BisGIfUYNYYFbvGz8Q3P+WY3c76QZM/gI0PzZKYkwEHCxTRftMgEkj3QS+9rpljfzCda8OcOhNpPHFKbfRJeHMzrnhN9TCZ7kIo+ZDiuQa6aptDUZ5XhQjE61HMLCZV9e5Ymo89aVHo63GRoPu+R6MZPBQ0xoLV9mqmUfbaMFCkUmJGlyT+cSdxWuAlx9cU/SROaVgwWjcXacD55CPB0lmj1i5/xqlprTwE2SkiHgyjH39nkO6DFkjr+qb7fobuOFf6lrD2zgdxs/uCD7P5i6qUFVsryY8morS8bSCi1gFQWob032K/JfxTe1zd5YtEtBmj93Gs/B7tQ0908Pq13nNlwdRdafs0zj2Kxyg8FNf6PIrp8YUDBhR/ZniW6et1OaC6AryONZXRoLZiQsFIB26XMErDV+iVx5yVkIW6y7r3J+90ImqpA5ZyaLBb5cqEvD+ysU9GkljzgyFg2St+syuucKmhVXY9uU4BEIamqaZ3grSNZvWbRRHOOi3iDV23T4QUY= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 in next patch. CC: Alexander Duyck CC: Andrew Morton CC: Linux-MM Signed-off-by: Yunsheng Lin Acked-by: Max Filippov Reviewed-by: Alexander Duyck --- 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) } ) -/* - * Pure 2^n version of get_order - * Use 'nsau' instructions if supported by the processor or the generic version. - */ - -#if XCHAL_HAVE_NSA - -static inline __attribute_const__ int get_order(unsigned long size) -{ - int lz; - asm ("nsau %0, %1" : "=r" (lz) : "r" ((size - 1) >> PAGE_SHIFT)); - return 32 - lz; -} - -#else - # include -#endif - struct page; struct vm_area_struct; extern void clear_page(void *page);