From patchwork Mon Mar 21 02:54:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhiyuan Dai X-Patchwork-Id: 12786760 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03C21C433EF for ; Mon, 21 Mar 2022 02:56:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6MafTPU6H1bx8qvdkOUXtBYj+X79bCTpWhwqG54qpXc=; b=hr83Xpu5yOZJdQ Ood3Mws4CfEFceBLkO09+iI+rep1f8XITJqCyBzxRGbMf8hjbw/4F/ZyyDJOVoAE1w78G6giD8xsy mQPniV+QJZq9VVejXjkzgjS3OXA93IdCLmQIGmXmQi+HP6Lt18YHEL2ZArx4DAA1SE/INVlx8acTI 6Zm7WrwfLisvKIgnYMGbtIAK/GAMzO1VKvu4fb+tqMZeHhFXmSt1mdowJiICKfIcC3rkhH6puvYrv AUMrwF3H6tAcLASSgjLoZ2Wq6LzW4tMKRj5JmyI3Cmcu1P0+HKM4EWSl0prdLAAWOgxIJbu5dBndm zzDto9npyu8+8Boawqcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nW8CJ-006LVB-6i; Mon, 21 Mar 2022 02:55:07 +0000 Received: from azure-sdnproxy.icoremail.net ([52.237.72.81] helo=azure-sdnproxy-1.icoremail.net) by bombadil.infradead.org with smtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nW8CD-006LUE-U6 for linux-arm-kernel@lists.infradead.org; Mon, 21 Mar 2022 02:55:04 +0000 Received: from prodtpl.icoremail.net (unknown [10.12.1.20]) by hzbj-icmmx-2 (Coremail) with SMTP id AQAAfwD3_Q4U6TdisyvAAg--.61505S2; Mon, 21 Mar 2022 10:55:16 +0800 (CST) Received: from centos7.localdomain (unknown [202.43.158.76]) by mail (Coremail) with SMTP id AQAAfwDnyqPt6DdiYiUAAA--.1485S3; Mon, 21 Mar 2022 10:54:38 +0800 (CST) From: Zhiyuan Dai To: catalin.marinas@arm.com, will@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Zhiyuan Dai Subject: [PATCH] arm64: assembler: Fine-tune code to improve code readability Date: Mon, 21 Mar 2022 10:54:34 +0800 Message-Id: <1647831274-3555-1-git-send-email-daizhiyuan@phytium.com.cn> X-Mailer: git-send-email 1.8.3.1 X-CM-TRANSID: AQAAfwDnyqPt6DdiYiUAAA--.1485S3 X-CM-SenderInfo: hgdl6xpl1xt0o6sk53xlxphulrpou0/ Authentication-Results: hzbj-icmmx-2; spf=neutral smtp.mail=daizhiyuan @phytium.com.cn; X-Coremail-Antispam: 1Uk129KBjvdXoW7Gr17XFWkCF17KF1xZr45trb_yoWDAFbEkw 1Sqw48GrWfJrZIqry8tF1FyFy0kw4kZFZxu3Wjkrn7Jr9Fv3W5Gws7JF9Y9r47WF15Ca1x ua4kJFWfJw1jqjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrnU Uv73VFW2AGmfu7jjvjm3AaLaJ3UjIYCTnIWjDUYxBIdaVFxhVjvjDU0xZFpf9x0zRUUUUU UUUU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220320_195502_361959_C0AC5B46 X-CRM114-Status: UNSURE ( 7.08 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch tweaks the code to improve readability. Defined values are: PMUVer == 0b0000 : Performance Monitors Extension not implemented. Signed-off-by: Zhiyuan Dai --- arch/arm64/include/asm/assembler.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index 6ebdc0f..efd43a1 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -489,11 +489,10 @@ */ .macro reset_pmuserenr_el0, tmpreg mrs \tmpreg, id_aa64dfr0_el1 - sbfx \tmpreg, \tmpreg, #ID_AA64DFR0_PMUVER_SHIFT, #4 - cmp \tmpreg, #1 // Skip if no PMU present - b.lt 9000f - msr pmuserenr_el0, xzr // Disable PMU access from EL0 -9000: + ubfx \tmpreg, \tmpreg, #ID_AA64DFR0_PMUVER_SHIFT, #4 + cbz \tmpreg, .Lskip_pmu_\@ // Skip if no PMU present + msr_s SYS_PMUSERENR_EL0, xzr // Disable PMU access from EL0 +.Lskip_pmu_\@: .endm /*