Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1701117lqe; Mon, 8 Apr 2024 18:31:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWUs9UbrT7NfNGgxI7H1FmucpgvmKXWWUVJ2t+KWbT+ME+MpnJ1S0tAy5yvSCjEVZinsLpkdc2SPDrpBwyoQq6Nl6wlOlKIevOu5UoYjQ== X-Google-Smtp-Source: AGHT+IEMjCMUkCv82Vqc3p+drQf8RV9oWkA8YJPkk4a2WFnP7G+KZ3bT/Asj9l1T75fYJj0+3AFt X-Received: by 2002:a17:907:60d0:b0:a51:d49f:b847 with SMTP id hv16-20020a17090760d000b00a51d49fb847mr3941943ejc.35.1712626274638; Mon, 08 Apr 2024 18:31:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712626274; cv=pass; d=google.com; s=arc-20160816; b=wC4quJD616mewmQmDnW/MY+30L6bfn0m/cbUEyyCjPyOXij8veRcyFKowuS6mkwpwG qXGJAawh7m93e5vRtJQMWOXnv3UUOArl6+Fr1A2o53Oaj4M1xu+LE6uHvQu/cDgzLIIE zklBHe3cZKdGILf71ft/FDDnajkEPRWsklwf2oULFmGnLWQu0tY99JFX2VKg3/uTI0jN kao+ot7K9Ik1w9zUQzId9p8g82y0MvWlgvwou0SXMgLBHsVQzfemyrARwmunbiUGD9Gu 8aaCtUjfoRGbmo69Pmgr22BnwYdIOmUDXVOKdC8v7zSYDFKTN/w1g7FA5pExhbUqeapt sY4g== 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=mRB287P6lq95F69FYYtjmRivg6y+IVmMG+fpecIJ9WA=; fh=RatWSVbNJ1/MmnzWWlcZp/KokkZi2YybezTbDh3X02M=; b=e26vtQ0a0ENvqkvQwS8HFSLipaMasz6zZHQHhJUdgnvayqdoyk4vMeH7fLxDkNQmx+ VFj6yTQXldMf0pt2ybF3ERzGBuXhehHNdWbiDDJquP3r2qXBEzjNM6DtwlBf+sVpcleW 6PQK01hnRvdZkEWnyT4YjDPqnjdhPXsZ72zihfRYHuI1xalCvz/qB4SO9f57NIs/TR4u g1CBvXWgyPUTj4fGgMJZe76G6FUouZ9uoNd4yqJaopojApb6dyR/BKoftKRLGLkmBl4z Ghrbg3LaShs2UR9CoZA6L7s05+QMHbk+eEQZelS5HsKqbRvX4ZFH1qDMf01cb3rU+iIh EykA==; 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-136082-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136082-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id uz28-20020a170907119c00b00a4df9028563si4216283ejb.161.2024.04.08.18.31.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 18:31:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136082-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-136082-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136082-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 42B601F229BE for ; Tue, 9 Apr 2024 01:31:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A50128C15; Tue, 9 Apr 2024 01:30:08 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (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 80F304F1FE for ; Tue, 9 Apr 2024 01:30:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712626208; cv=none; b=entRgoWR0jpq09RE40b7vbfScudbD+S+ScyEBfy++gta6VQ350K7NOe5sAhRKpmBFWtmuvb++/rIyhcu7L3uIlmp8S7LPTP0eV0ii/jNb8JKcnthZlcXprYKXDjwDIH9+nNy8LmStWY6HWnHwszCBBye1B/FL/aFSStMsuOsl64= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712626208; c=relaxed/simple; bh=5r+ijZQ5MH7I7vPvW7C5wUqEXvulF+LJcjAwi2rEDXg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sksAjSvNWJPmhphtBqq1db85Hum2TuSV2DnaEw4+16TJyFAyJzY/u9k+kZ8VWEqUYmTrtAMFpez7nsxoA55QjbnDF6R1IZNuDyWUj83OX8nrPYFPP9icOJOfsZoYgQRpwE7PAtvIT3MQzuoWz0YrM5ZzsY7DEBWOimk1fRh0nMs= 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.191 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.162.112]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VD7fP0gDRz1GG1Y; Tue, 9 Apr 2024 09:29:17 +0800 (CST) Received: from kwepemd200013.china.huawei.com (unknown [7.221.188.133]) by mail.maildlp.com (Postfix) with ESMTPS id A071D140384; Tue, 9 Apr 2024 09:30:01 +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:30:00 +0800 From: Liao Chang To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Subject: [PATCH 5/9] arm64/cpufeature: Use alternatives to check enabled ARM64_HAS_NMI feature Date: Tue, 9 Apr 2024 01:23:40 +0000 Message-ID: <20240409012344.3194724-6-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> 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: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemd200013.china.huawei.com (7.221.188.133) Due to the historical reasons, cpus_have_const_cap() is more complicated than it needs to be. When CONFIG_ARM64_NMI=y the ARM64_HAS_NMI cpucap is a strict boot cpu feature which is detected and patched early on the boot cpu, which means no code depends on ARM64_HAS_NMI cpucap run in the window between the ARM64_HAS_NMI cpucap is detected and alternative is patched. So it would be nice to migrate caller over to alternative_has_cap_likey(). Signed-off-by: Liao Chang --- arch/arm64/include/asm/cpufeature.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h index dc8b2d0d3763..4c35565ad656 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h @@ -803,7 +803,7 @@ static __always_inline bool system_uses_irq_prio_masking(void) static __always_inline bool system_uses_nmi(void) { return IS_ENABLED(CONFIG_ARM64_NMI) && - cpus_have_const_cap(ARM64_USES_NMI); + alternative_has_cap_likely(ARM64_USES_NMI); } static inline bool system_supports_mte(void) -- 2.34.1