From patchwork Mon Jan 20 05:00:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 3510811 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F39CC9F2D6 for ; Mon, 20 Jan 2014 05:01:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 33C4020108 for ; Mon, 20 Jan 2014 05:01:09 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DCD99200F0 for ; Mon, 20 Jan 2014 05:01:07 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W56yn-0002gk-Ub; Mon, 20 Jan 2014 05:00:58 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W56yl-0003nf-Gs; Mon, 20 Jan 2014 05:00:55 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W56yg-0003mz-Mg for linux-arm-kernel@lists.infradead.org; Mon, 20 Jan 2014 05:00:52 +0000 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MZO0048FOKNSGE0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 20 Jan 2014 14:00:23 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.49]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 7F.E4.10092.66DACD25; Mon, 20 Jan 2014 14:00:22 +0900 (KST) X-AuditID: cbfee68f-b7f156d00000276c-89-52dcad66077c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 1E.A9.28157.66DACD25; Mon, 20 Jan 2014 14:00:22 +0900 (KST) Received: from DOJG1HAN03 ([12.23.120.99]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MZO005E3OKLK260@mmp1.samsung.com>; Mon, 20 Jan 2014 14:00:21 +0900 (KST) From: Jingoo Han To: 'Catalin Marinas' Subject: [PATCH v2] arm64: mm: use ubfm for dcache_line_size Date: Mon, 20 Jan 2014 14:00:21 +0900 Message-id: <002501cf159c$85a358b0$90ea0a10$%han@samsung.com> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac8VnIWLU9XvjMg4QQ6owuz87F0H/g== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFIsWRmVeSWpSXmKPExsVy+t8zQ920tXeCDLYe4Lb4/2E3o8X7ZT2M FpcXXmK12PT4GqvFy48nWBxYPdbMW8PocefaHjaPzUvqPfq2rGIMYInisklJzcksSy3St0vg ylj1IK3gMXvF/RsXmRsY57J1MXJySAiYSDTtOcUIYYtJXLi3HijOxSEksIxR4trP+UwwRe/b bjJBJBYxSix+uwCq6hejxOr/Z8Cq2ATUJL58OcwOYosI6Eu8P72YBaSIWWAxo8TCSzfBdggL 2Ei8Ob6ABcRmEVCVWDPxDVgDr4CtxJYlD5ghbEGJH5PvgdUwC2hJrN95nAnClpfYvOYtUA0H 0EnqEo/+6kLs0pM4svEJK0SJiMS+F++g3tnFLvHvlh3EKgGJb5MPsUC0ykpsOsAMUSIpcXDF DZYJjGKzkCy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ysuxDFa/yxmdI45 2v5j7tusXIv+5v/885eIfgqaVdWv6uQVYe7DrWN8+JjnGmevLFnhyXtiV+1cK7WAq0wqctMC Q7nT9RsCou6nvgxVV6ztkPube7gpYztT6py9zbvWd6TffXe20mXJVk+P/W3FVdekfR8yrTub pabEUpyRaKjFXFScCACUxmGmKwMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140120_000051_275092_B06BAB0C X-CRM114-Status: UNSURE ( 8.14 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.4 (-------) Cc: 'Jingoo Han' , 'Will Deacon' , linux-arm-kernel@lists.infradead.org, 'Ard Biesheuvel' X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use 'ubfm' for the bitfield move instruction; thus, single instruction can be used instead of two instructions, when getting the minimum D-cache line size from CTR_EL0 register. Signed-off-by: Jingoo Han --- Change since v1 - Remove unnecessary prefix '0x' from immediates, per Will Deacon - Add '#' to immediates for consistency, per Ard Biesheuvel arch/arm64/mm/proc-macros.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/mm/proc-macros.S b/arch/arm64/mm/proc-macros.S index 8957b82..005d29e 100644 --- a/arch/arm64/mm/proc-macros.S +++ b/arch/arm64/mm/proc-macros.S @@ -38,8 +38,7 @@ */ .macro dcache_line_size, reg, tmp mrs \tmp, ctr_el0 // read CTR - lsr \tmp, \tmp, #16 - and \tmp, \tmp, #0xf // cache line size encoding + ubfm \tmp, \tmp, #16, #19 // cache line size encoding mov \reg, #4 // bytes per word lsl \reg, \reg, \tmp // actual cache line size .endm