Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp218841lqg; Wed, 10 Apr 2024 23:56:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1YRCB9AwYdU8OJ9gwsl60YXGGm/VM01faVSRCGp1Tsf0as+uFpMNc6yp3UHuq/weE8uLhcFoc9YUj7kM2rBtm/RGsb42Q4GRl5JK3RQ== X-Google-Smtp-Source: AGHT+IG5Hr84jE8qVrsUJkb7W3kQfrM2aI5eguA1zigKiuMUMOWprV3ETYbBQIABJgvZNcJmZCnN X-Received: by 2002:a05:6512:49c:b0:515:a8e0:bf3c with SMTP id v28-20020a056512049c00b00515a8e0bf3cmr3770876lfq.32.1712818599478; Wed, 10 Apr 2024 23:56:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712818599; cv=pass; d=google.com; s=arc-20160816; b=ASNPGSU4XveyJNeQ5VV81vZOObWYzwztl3mDdrgMraG9yOW8XOiNWwns0ZOirosACI y8RKWdPvvakz9DJZ6JtTfaxrPShwHYbA49U/11GjGiepwUqq8azmNufM4A/VZggHuDEG ESQaPyzOFvD/pqbbz8TWgdMf24iRfpQSqHA42ZYhsRw+pqPNYMEIFY0wj25a7M5+taPy 6T1QuJIVGOHP1IMMP6Pur3qj+BkrdEucpXe8M1sJA+AbwHtNmzNmX4Nwtmb7asHDRGk/ Gp8nRk4pG/N58fs+2UIOIHN+aHRTr6cPX0UdC1wzdUvSp+qF8BG1QlHB04lU3nXj+JAp kNZw== 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=YdO+N/xgHGUZo91bKIWUSgUg8Z1p+7IAoQc3PdTUf0o=; b=JsYrut/0cwxkDyI/X7p5KG5RlE+ktIRC89RsoN1U3zPdVDgDYsffXFXAQA57tVz25R C/2nQZ8F7IMwVyiw525E36yFjk65b/y2CZTJMDhcLlB/cZajRAB1DeihURSFALPOj8cK Rbg0nrpspWn/4f3It4z5ZRD97Lxl4pefKTOr4V7pfqPMC9KfZ/HlYIUocuOtx/S5KVv/ x6BM5XY6n3tlMk7wLuWEZZpMWbvuA+X4t0JR6i0Z46SA6uryz8nasV+CBycUG/eshXtO YAACZviHTMnMJFQQWxyjnQR3YPBv9mYDVb30aiUME7oeXZecEf4HdRtGWNam1+a5cjcv 4QzA==; 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-139893-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139893-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 j13-20020a05640211cd00b0056e53562ed2si459483edw.532.2024.04.10.23.56.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 23:56:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139893-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-139893-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139893-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 344881F2017B for ; Thu, 11 Apr 2024 06:56:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F11C13E88E; Thu, 11 Apr 2024 06:55:25 +0000 (UTC) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (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 8844D13E036 for ; Thu, 11 Apr 2024 06:55:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712818525; cv=none; b=QAFxxf42t4OD0w9JBvDLdMP1nWr4LG/8SNW5WJZHpTMUClJAz5l0dT5GSzGV0KLJWyDAKpHceVC6jKgQChxC5QRhhF82V1opBTSoTK/gk+5C9T3FDcRf7Vehi0eQjHzjxxfwwh944bbtR5WIXLGh6SbieUZfkX7vB9rflEn+7IM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712818525; c=relaxed/simple; bh=5r+ijZQ5MH7I7vPvW7C5wUqEXvulF+LJcjAwi2rEDXg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=STMqxQpFf3AHMuIH4wpJKb1NQpDb3Ur5VMf5l53BvXgW07xp5o1PYnZiZaJ1Yw/6BLnBl5KY3FOk+z6wZeD7kmnytpK/JWhCk0tKbhlEUR+WYEwzAtGHdEEVpcUCx+sXqYcCwIaZOFsQl5Zs1UTGiz799tHMtwnWwD68oS7YOa8= 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.190 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.44]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4VFVl35Sj3z1yn1g; Thu, 11 Apr 2024 14:53:03 +0800 (CST) Received: from kwepemd200013.china.huawei.com (unknown [7.221.188.133]) by mail.maildlp.com (Postfix) with ESMTPS id 550DF14013B; Thu, 11 Apr 2024 14:55:20 +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:18 +0800 From: Liao Chang To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Subject: [PATCH v2 5/9] arm64/cpufeature: Use alternatives to check enabled ARM64_HAS_NMI feature Date: Thu, 11 Apr 2024 06:48:54 +0000 Message-ID: <20240411064858.3232574-6-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) 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