From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2016B746B for ; Thu, 16 Feb 2023 14:21:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7800C4339C; Thu, 16 Feb 2023 14:21:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676557309; bh=QRffr5dG9qV+Mk/7oMoWKSJpm06ScxM7lQsl0hcQHQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G0R0zd7+N/6xpobqzQnhapJnYFt46DAkYc0odAZ4v0nt/ErKM+/Sd4rCOd74GyZnX 1pw7fVoUZLBToyGjRlME6h6rsEP3GNFobmzkv0RRQFrJIgIn5Q2BxaTWm0UyBo+XMY WIkGY6mMYIxcVTvdf4HpHZ7Q8rHKiqxsoNbiXejlj3lRBDXRINEXTIasvB+azXwT4U c6dbjvv5k1O3l1hxK1UE7VNoWytl5hBi29kV4i7J+oLUvh9ic7uOk5MNFNOrxhiyaa D1uTIt9Fc9kXW7xkLANjtqWcFpNczz+2//0WkWBQIC09P+gg079CjinsuzPOFt/3nc NtjTDDY72K6gg== 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 1pSf8t-00AuwB-Kp; Thu, 16 Feb 2023 14:21:47 +0000 From: Marc Zyngier To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Ricardo Koller , Simon Veith , dwmw2@infradead.org Subject: [PATCH 02/16] arm64: Add HAS_ECV_CNTPOFF capability Date: Thu, 16 Feb 2023 14:21:09 +0000 Message-Id: <20230216142123.2638675-3-maz@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216142123.2638675-1-maz@kernel.org> References: <20230216142123.2638675-1-maz@kernel.org> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, ricarkol@google.com, sveith@amazon.de, dwmw2@infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Add the probing code for the FEAT_ECV variant that implements CNTPOFF_EL2. Why is it optional is a mystery, but let's try and detect it. Signed-off-by: Marc Zyngier --- arch/arm64/kernel/cpufeature.c | 11 +++++++++++ arch/arm64/tools/cpucaps | 1 + 2 files changed, 12 insertions(+) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 23bd2a926b74..36852f96898d 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2186,6 +2186,17 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .sign = FTR_UNSIGNED, .min_field_value = 1, }, + { + .desc = "Enhanced Counter Virtualization (CNTPOFF)", + .capability = ARM64_HAS_ECV_CNTPOFF, + .type = ARM64_CPUCAP_SYSTEM_FEATURE, + .matches = has_cpuid_feature, + .sys_reg = SYS_ID_AA64MMFR0_EL1, + .field_pos = ID_AA64MMFR0_EL1_ECV_SHIFT, + .field_width = 4, + .sign = FTR_UNSIGNED, + .min_field_value = 2, + }, #ifdef CONFIG_ARM64_PAN { .desc = "Privileged Access Never", diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps index 82c7e579a8ba..6a26a4678406 100644 --- a/arch/arm64/tools/cpucaps +++ b/arch/arm64/tools/cpucaps @@ -23,6 +23,7 @@ HAS_DCPOP HAS_DIT HAS_E0PD HAS_ECV +HAS_ECV_CNTPOFF HAS_EPAN HAS_GENERIC_AUTH HAS_GENERIC_AUTH_ARCH_QARMA3 -- 2.34.1 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 EFEDAC636CC for ; Thu, 16 Feb 2023 14:23:58 +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=qDKSz/tn7q0uOAbrf85d4Qc4/mIrAxQt6vHTCatqwr8=; b=uPOUSMd35U1lBa Irk9hyOQAezRmHJRQXdyapQf/juOIUOqYOqOpXTJIrEdSBjCuCCfL+QIv0CeUSdLod6pYYvbSCaY/ b/JAoksIU2cZJ6zaixyt/yUxHkZitImf9U1akcaBhIy2VhlwZg64tVnk+OLKXB3BvjpZHqoXXPmOq jDbl2Zrbnjq31yQLaaVjSY+/J711cYbVlEIjFepBezG/S12PefzQgta5sHAq1zt5WMReEpWjFJaTa bU6FrbLgrlSA5P0WtedhWzVcacUaQFoyf6v9tOdjQMJJ5rlv4TLVfQnRuqqU/n5FG1giFqZR6OSFo vycZmbQ+4ShdODe+9nEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pSf9w-00AZr8-Fr; Thu, 16 Feb 2023 14:22:53 +0000 Received: from desiato.infradead.org ([90.155.92.199]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pSf99-00AZYP-6X for linux-arm-kernel@bombadil.infradead.org; Thu, 16 Feb 2023 14:22:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=mQzkBQGITtInYJZNcTDli4NqjRleDG2OVYhk8EyzY/0=; b=RsDYAaGb2xMqf7eyZHtXjrvlrs OxbyjPEyNxiC2G9UIcji+fm+Te3rya9jFdI0E07OcJdZVE01SwIkk5s+fwqCUL8TjukjcwwdKod/5 1fXQjuIyB9ydvfvngSDdvlumyibOJPTxjixcHyNB6Bue7S89H/H3nmXmmsjiJwtsXIqoSeIednVEa kT+rcQGxF158Ha++xm494TnBbpDHC+EbFN28+Yjd5HVDQshvLJIH7HFwNa14jSaZpuwS9fPaiapZh l1llKd5NZjhh8Z4u2d6kaTVKFTTQtr7QxSaPkGqKQJ5tRvUvw9xPd27MQ986APMTRclsBtNSQobbB TIcPSD0Q==; Received: from ams.source.kernel.org ([145.40.68.75]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pSf8L-00AItW-2T for linux-arm-kernel@lists.infradead.org; Thu, 16 Feb 2023 14:22:01 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 05A77B8282E; Thu, 16 Feb 2023 14:21:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7800C4339C; Thu, 16 Feb 2023 14:21:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676557309; bh=QRffr5dG9qV+Mk/7oMoWKSJpm06ScxM7lQsl0hcQHQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G0R0zd7+N/6xpobqzQnhapJnYFt46DAkYc0odAZ4v0nt/ErKM+/Sd4rCOd74GyZnX 1pw7fVoUZLBToyGjRlME6h6rsEP3GNFobmzkv0RRQFrJIgIn5Q2BxaTWm0UyBo+XMY WIkGY6mMYIxcVTvdf4HpHZ7Q8rHKiqxsoNbiXejlj3lRBDXRINEXTIasvB+azXwT4U c6dbjvv5k1O3l1hxK1UE7VNoWytl5hBi29kV4i7J+oLUvh9ic7uOk5MNFNOrxhiyaa D1uTIt9Fc9kXW7xkLANjtqWcFpNczz+2//0WkWBQIC09P+gg079CjinsuzPOFt/3nc NtjTDDY72K6gg== 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 1pSf8t-00AuwB-Kp; Thu, 16 Feb 2023 14:21:47 +0000 From: Marc Zyngier To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Ricardo Koller , Simon Veith , dwmw2@infradead.org Subject: [PATCH 02/16] arm64: Add HAS_ECV_CNTPOFF capability Date: Thu, 16 Feb 2023 14:21:09 +0000 Message-Id: <20230216142123.2638675-3-maz@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216142123.2638675-1-maz@kernel.org> References: <20230216142123.2638675-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, ricarkol@google.com, sveith@amazon.de, dwmw2@infradead.org 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-20230216_142157_546113_ECA7A16A X-CRM114-Status: GOOD ( 13.68 ) 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 Add the probing code for the FEAT_ECV variant that implements CNTPOFF_EL2. Why is it optional is a mystery, but let's try and detect it. Signed-off-by: Marc Zyngier --- arch/arm64/kernel/cpufeature.c | 11 +++++++++++ arch/arm64/tools/cpucaps | 1 + 2 files changed, 12 insertions(+) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 23bd2a926b74..36852f96898d 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2186,6 +2186,17 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .sign = FTR_UNSIGNED, .min_field_value = 1, }, + { + .desc = "Enhanced Counter Virtualization (CNTPOFF)", + .capability = ARM64_HAS_ECV_CNTPOFF, + .type = ARM64_CPUCAP_SYSTEM_FEATURE, + .matches = has_cpuid_feature, + .sys_reg = SYS_ID_AA64MMFR0_EL1, + .field_pos = ID_AA64MMFR0_EL1_ECV_SHIFT, + .field_width = 4, + .sign = FTR_UNSIGNED, + .min_field_value = 2, + }, #ifdef CONFIG_ARM64_PAN { .desc = "Privileged Access Never", diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps index 82c7e579a8ba..6a26a4678406 100644 --- a/arch/arm64/tools/cpucaps +++ b/arch/arm64/tools/cpucaps @@ -23,6 +23,7 @@ HAS_DCPOP HAS_DIT HAS_E0PD HAS_ECV +HAS_ECV_CNTPOFF HAS_EPAN HAS_GENERIC_AUTH HAS_GENERIC_AUTH_ARCH_QARMA3 -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel