From patchwork Tue Apr 9 01:23:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liao Chang X-Patchwork-Id: 13621698 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 2A642C67861 for ; Tue, 9 Apr 2024 01:30:36 +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=65rsuqEinlyjMf+WSFTDGha4RcHZ+fDQmi8GpwCFmZc=; b=xQ/toKbWCqYgQ6 8ZRAsfZMcaQrMBkyLuewWseUrUUuobx5a+DMoq4IV+kB8ogtORMYyCu9skh+YI0l+7zYiM11pdwHr yQ2tM5IiksweulUsKp8VRCzOGT6GItn8woqa6mSolOdlANyiOCIpd5rr8cItNcCP5mn6SyF3wuw1/ d2s9KNz1BuqsYqvF34dGWsGhuO7BLPNkDU7eybmsyjlY14cgHaOeR2tTYR3mMUYucjKVNwSVM0TMQ jErwH3nGUZ92WF6PyNkdAQoRnyO7gFfN879KEUx1qBn1ATwSMfXUqwgOZsNBSeEhAVSzlgyIItuSm 85uuBGna4fHW8aW3U5TA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ru0Je-0000000HOdy-0Rcl; Tue, 09 Apr 2024 01:30:26 +0000 Received: from szxga03-in.huawei.com ([45.249.212.189]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ru0JK-0000000HOVY-2Qne for linux-arm-kernel@lists.infradead.org; Tue, 09 Apr 2024 01:30:09 +0000 Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4VD7cf02b2zNn6P; Tue, 9 Apr 2024 09:27:46 +0800 (CST) Received: from kwepemd200013.china.huawei.com (unknown [7.221.188.133]) by mail.maildlp.com (Postfix) with ESMTPS id 8CEAC18007D; Tue, 9 Apr 2024 09:30:00 +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; Tue, 9 Apr 2024 09:29:59 +0800 From: Liao Chang To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Subject: [PATCH 4/9] arm64/cpufeature: Simplify detect PE support for FEAT_NMI Date: Tue, 9 Apr 2024 01:23:39 +0000 Message-ID: <20240409012344.3194724-5-liaochang1@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240409012344.3194724-1-liaochang1@huawei.com> References: <20240409012344.3194724-1-liaochang1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.174.28] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) 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-20240408_183007_377569_65D74E94 X-CRM114-Status: UNSURE ( 8.46 ) 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 --- 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 {},