From mboxrd@z Thu Jan 1 00:00:00 1970 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 AE8ADC4332F for ; Mon, 13 Nov 2023 17:44:17 +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=CrS6EF/b7wwjgXX1Yu6jS1xrb1MUN97+hAkQN+VeFOY=; b=pu7zHanPJriSUV cG9mB4ZyWclv05kh2BPqhnqdPMPNN+ERP12pqGr8KbBXw98Ly9AFkJMuNHXn6STsOjqusDgfzzR1y 31sZOkVaYpT4CKMn/MJ8jz5WpIjE+sCBWco67KiO02oMp+1Icp9LgmZz8/1/zWp9baQleQkA52qYm vHs91OHlnZBCcdfbHsedThUqnwvC5eHXxVbdL5X1E9Iz2WTyzyqrL8zkTNDc8/oZH81GdOYQ4Z65s JxUK4V3FUhnGvDsZKS7FZpwtJFt3oegqDBxQOfCfPPVZTeHGBlzP+8xqSyh8aXvi8knKRZRw7xhZ4 k1Q5qMAGe04cQN7sLw6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2aya-00EQ7K-0z; Mon, 13 Nov 2023 17:43:56 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2ayP-00EPyy-32 for linux-arm-kernel@lists.infradead.org; Mon, 13 Nov 2023 17:43:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5EF7160FE5; Mon, 13 Nov 2023 17:43:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC4E0C433CD; Mon, 13 Nov 2023 17:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699897424; bh=lynjrJEz/BHjtI6s1T8jQIpyNGuzaukrA+2hTJuP2Mg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JRl3MXPU9/aZShzMizT5iDDZ/W4Qih2a7IP251CKZwMw615Sl33hn0ZfpRanjYv3Z Sx7Xx7eOmWZu9KVGkiur/uhBKdDy4ObWeBM9qyugQuBznq0EhzfY1CsQrANfJNfO5i E2ac7U/LQAlSdrdAUyBTSx2sOPgtK/J1VROLMZZtFpk9FF4jWWhbBVVRdQ8LihyEmt pMyPi2ECagAGKsTsI6xcu99UqtS/pDGbcIBS1TeVZmVXPhb6D5tkvVA/ixKfBzBymv OvKaKsXHjLgW3rKTqslBDWwT38nIJx3Hp8rQb52I8MNxi0BcPcow9sI9FcUVF+/DOG Sk6O3mYTxsW9w== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1r2ayM-00CkQ4-Qs; Mon, 13 Nov 2023 17:43:42 +0000 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Cc: Catalin Marinas , Will Deacon , Mark Rutland , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: [PATCH 05/12] arm64: cpufeature: Detect E2H0 not being implemented Date: Mon, 13 Nov 2023 17:42:37 +0000 Message-Id: <20231113174244.3026520-6-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231113174244.3026520-1-maz@kernel.org> References: <20231113174244.3026520-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231113_094346_022435_466A250E X-CRM114-Status: GOOD ( 11.87 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org FEAT_E2H0 is a new feature that indicates whether or not HCR_EL2.E2H can be set to 0. Amusingly, this feature is set to 0 when implemented, and otherwise negative. Add a new capability and detection infrastructure to detect the absence of FEAT_E2H0. Signed-off-by: Marc Zyngier --- arch/arm64/kernel/cpufeature.c | 7 +++++++ arch/arm64/tools/cpucaps | 1 + 2 files changed, 8 insertions(+) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 41db7f993eef..e0d64e8b4851 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2787,6 +2787,13 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .matches = has_cpuid_feature, ARM64_CPUID_FIELDS(ID_AA64MMFR2_EL1, EVT, IMP) }, + { + .desc = "FEAT_E2H0 not implemented", + .capability = ARM64_HCR_E2H_RES1, + .type = ARM64_CPUCAP_SYSTEM_FEATURE, + .matches = has_cpuid_feature, + ARM64_CPUID_FIELDS_NEG(ID_AA64MMFR4_EL1, E2H0, NI) + }, {}, }; diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps index b98c38288a9d..8866ea9bf995 100644 --- a/arch/arm64/tools/cpucaps +++ b/arch/arm64/tools/cpucaps @@ -52,6 +52,7 @@ HAS_TIDCP1 HAS_TLB_RANGE HAS_VIRT_HOST_EXTN HAS_WFXT +HCR_E2H_RES1 HW_DBM KVM_HVHE KVM_PROTECTED_MODE -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel