From patchwork Thu Apr 11 06:48:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Chang X-Patchwork-Id: 13625477 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 2707CCD1292 for ; Thu, 11 Apr 2024 06:55:51 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=4f1RtKpSD94w28wl3XBlQND3Qb91i58k1OKN1/ARgsA=; b=frRyCT3CdizsHh Dphe9PU1x+EEcpP37fuJQXVt3H5W+E+aveO3kl3w5pGLM86E2/ow/5R1DeGZKJwy9YdukL3Qwc35M BTdm7e1Y1i+CLnz4mn3UgYil0Xj4WACBgffJr3qLqtqrJQBaMjb+agNPACnpbMfD2IQcnFOHRwtXq 9iDjFkRmYa20lVGHLA60t4+T+T94bXLkJLAOT0cSi9AvsjV3G2Zpz4GmyW4uBumtM7fH8u1yDHLEG xcbVnJoG1Ihorum3d5rpvzuaz5il+0O/3/8TGCEcbOGJPOtgWrSYknIZnoIe4u53ssD1dt1IaRjpJ B6eE8zkiEnA/FIrkhuPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruoLO-0000000Agh1-0LSm; Thu, 11 Apr 2024 06:55:34 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruoLE-0000000AgXS-33me for linux-arm-kernel@lists.infradead.org; Thu, 11 Apr 2024 06:55:27 +0000 Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VFVk14F7szXlLJ; Thu, 11 Apr 2024 14:52:09 +0800 (CST) Received: from kwepemd200013.china.huawei.com (unknown [7.221.188.133]) by mail.maildlp.com (Postfix) with ESMTPS id 1A7D9140E9F; Thu, 11 Apr 2024 14:55:19 +0800 (CST) Received: from huawei.com (10.67.174.28) by kwepemd200013.china.huawei.com (7.221.188.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Thu, 11 Apr 2024 14:55:17 +0800 From: Liao Chang To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Subject: [PATCH v2 4/9] arm64/cpufeature: Simplify detect PE support for FEAT_NMI Date: Thu, 11 Apr 2024 06:48:53 +0000 Message-ID: <20240411064858.3232574-5-liaochang1@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240411064858.3232574-1-liaochang1@huawei.com> References: <20240411064858.3232574-1-liaochang1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.174.28] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemd200013.china.huawei.com (7.221.188.133) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240410_235525_301063_855C295D X-CRM114-Status: UNSURE ( 8.99 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Jinjie Ruan Simplify the Non-maskable Interrupts feature implementation with ARM64_CPUID_FIELDS macro. Signed-off-by: Jinjie Ruan Signed-off-by: Liao Chang --- arch/arm64/kernel/cpufeature.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index fb9e52c84fda..99c3bc74008d 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2905,24 +2905,16 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .desc = "Non-maskable Interrupts present", .capability = ARM64_HAS_NMI, .type = ARM64_CPUCAP_BOOT_CPU_FEATURE, - .sys_reg = SYS_ID_AA64PFR1_EL1, - .sign = FTR_UNSIGNED, - .field_pos = ID_AA64PFR1_EL1_NMI_SHIFT, - .field_width = 4, - .min_field_value = ID_AA64PFR1_EL1_NMI_IMP, .matches = has_cpuid_feature, + ARM64_CPUID_FIELDS(ID_AA64PFR1_EL1, NMI, IMP) }, { .desc = "Non-maskable Interrupts enabled", .capability = ARM64_USES_NMI, .type = ARM64_CPUCAP_BOOT_CPU_FEATURE, - .sys_reg = SYS_ID_AA64PFR1_EL1, - .sign = FTR_UNSIGNED, - .field_pos = ID_AA64PFR1_EL1_NMI_SHIFT, - .field_width = 4, - .min_field_value = ID_AA64PFR1_EL1_NMI_IMP, .matches = use_nmi, .cpu_enable = nmi_enable, + ARM64_CPUID_FIELDS(ID_AA64PFR1_EL1, NMI, IMP) }, #endif {},