Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp222805lqg; Thu, 11 Apr 2024 00:06:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVVPonW8QCDYSFDy5Sh+K7El8BbN7ZaYsbqSp9o/Zx82k2zAxO+YdlhVX3qb5cHMrq6eT3Xnf3+25wcY9HPKtRm+3Tz0MISG2CexMJvkA== X-Google-Smtp-Source: AGHT+IFsU0bSUBBK3WK/b+FPD/qubDqKVaePSQnCo8q4VGZHdgOR38m6d4tONZI+CU2gGKZFDxjx X-Received: by 2002:a05:6870:3508:b0:22e:bdf5:137b with SMTP id k8-20020a056870350800b0022ebdf5137bmr5725116oah.42.1712819189305; Thu, 11 Apr 2024 00:06:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712819189; cv=pass; d=google.com; s=arc-20160816; b=U4cQvd7hhSsgC3GrjwBJplStsgaW/lVQv6okidMC2aP83e6N6pGR4Llo8dtW1TUAGZ JOWZy6sGfe+klsAvbTKPW+1QyKnSRci5hZeNpK9Vikb0dzJMODl493jboy4JFT8h33PQ 7M1pywVorylj/Q/UyikUIt9gbBp86tmjKUi1xzakk5tm6Z9i3GY59jusMaZk/xRubeSg ptCqx/uZJDq/67cI7+UWH9RObDSuMjLRCFhIoY34bpMZjFOjM2egtvMSyDOiWWA3BCj6 UFPSZXXIgcf3D3KkBP+n7SjJ9QuzNlsADV/XXz0cHiq40zzUQ9i9BbyS0IQCT48ctJw0 p1yQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=bhLWaQel11xWfyPkAEwKo8pbbSSt59AkOLgEeVXKk+M=; fh=YdO+N/xgHGUZo91bKIWUSgUg8Z1p+7IAoQc3PdTUf0o=; b=GU4fuLxMtCbVfK3lGQjICLzO57ujdrx+zSIB/6WEO5znph6ai2FQSGGXffEGMhHCYX eJSiaQXZy3cjAnywjt8CSXNwDLtDOWcLh9FRG2pf5RyxwlTONhLZ/jtrIkjlGdBHWCFm 2H4LBE8lVuVJvZxqJE2HC68H5LA+TNAOvBaOQc93SUXmdoqsWUB5GxbIpVflXiX7heHn 6G2bwaLxJi572mGMKAy1B1ue5O5GEmTYZ4rFW1lNLTkxZclbGfb4c57tfk11YsINx9mA 7+ZeZmWyen8C7+4IGvrq75EYd1B41CRMEsItRTus81Q4y2fJd2AcI1P8jM9p0SJGc0Jc NLFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-139892-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139892-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 26-20020a63195a000000b005cda184c281si761056pgz.199.2024.04.11.00.06.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 00:06:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139892-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-139892-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139892-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 35908B27AD9 for ; Thu, 11 Apr 2024 06:56:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61C3113E3EA; Thu, 11 Apr 2024 06:55:23 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 056F813DDC4 for ; Thu, 11 Apr 2024 06:55:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712818522; cv=none; b=P2ypg931Qf6dbVoPG1E+b3W+WNooLbhEBU+wDnVHXByyynMpewpcUEko1GqdIbiKJLNTGuMYZ7sqfgi8XmwBa8Przd1DMFZE5vdpQ+apRStWMNYo//QvNhHvrInEfyS79jLqCIcg6+oxUIHK4GObcyLJrT0pv1L7Gh0EfGs+D48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712818522; c=relaxed/simple; bh=vRaAWJBmEkfrKydlBrm0tEA+Ytbuvo+lXPgTBsQ0fvA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mLJJ9WNC70ie9QhoSWByL6zGs8vM7Ta0RBmC9sRgTUrVrQEpIY+3FY6HRKEDZO7EpYoID24N3ZEZwyFJQutWacI8i9hW0ct254KhAw586xWcT+F5RCYdziIk/e4Tx7biuFKWka8UAybmH7rCYZAX47NTkeC1SizkEA/IKrR0wCQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemd200013.china.huawei.com (7.221.188.133) 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 {}, -- 2.34.1