public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
To: linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org, maz@kernel.org
Cc: christoffer.dall@linaro.org, eauger@redhat.com,
	miguel.luis@oracle.com, darren@os.amperecomputing.com,
	scott@os.amperecomputing.com, gankulkarni@os.amperecomputing.com
Subject: [PATCH 1/2] KVM: arm64: timers: Move helper has_cntpoff to a header file
Date: Wed, 16 Aug 2023 23:03:13 -0700	[thread overview]
Message-ID: <20230817060314.535987-2-gankulkarni@os.amperecomputing.com> (raw)
In-Reply-To: <20230817060314.535987-1-gankulkarni@os.amperecomputing.com>

Move helper function has_cntpoff() to header file as an inline
function to make it available to other functions as well.

Signed-off-by: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
---
 arch/arm64/include/asm/virt.h | 5 +++++
 arch/arm64/kvm/arch_timer.c   | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h
index 4eb601e7de50..f22cc733efb1 100644
--- a/arch/arm64/include/asm/virt.h
+++ b/arch/arm64/include/asm/virt.h
@@ -132,6 +132,11 @@ static __always_inline bool has_vhe(void)
 		return cpus_have_final_cap(ARM64_HAS_VIRT_HOST_EXTN);
 }
 
+static __always_inline bool has_cntpoff(void)
+{
+	return (has_vhe() && cpus_have_final_cap(ARM64_HAS_ECV_CNTPOFF));
+}
+
 static __always_inline bool is_protected_kvm_enabled(void)
 {
 	if (is_vhe_hyp_code())
diff --git a/arch/arm64/kvm/arch_timer.c b/arch/arm64/kvm/arch_timer.c
index 75bddab3224f..98b0e8ac02ae 100644
--- a/arch/arm64/kvm/arch_timer.c
+++ b/arch/arm64/kvm/arch_timer.c
@@ -55,11 +55,6 @@ static struct irq_ops arch_timer_irq_ops = {
 	.get_input_level = kvm_arch_timer_get_input_level,
 };
 
-static bool has_cntpoff(void)
-{
-	return (has_vhe() && cpus_have_final_cap(ARM64_HAS_ECV_CNTPOFF));
-}
-
 static int nr_timers(struct kvm_vcpu *vcpu)
 {
 	if (!vcpu_has_nv(vcpu))
-- 
2.41.0


  reply	other threads:[~2023-08-17  6:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17  6:03 [PATCH 0/2] Avoid spurious ptimer interrupts for non-zero cntpoff Ganapatrao Kulkarni
2023-08-17  6:03 ` Ganapatrao Kulkarni [this message]
2023-08-17  6:03 ` [PATCH 2/2] KVM: arm64: timers: Adjust CVAL of a ptimer across guest entry and exits Ganapatrao Kulkarni
2023-08-17  8:27   ` Marc Zyngier
2023-08-17  9:27     ` Ganapatrao Kulkarni
2023-08-17 10:04       ` Marc Zyngier
2023-08-22 12:16       ` Marc Zyngier
2023-08-22 14:57         ` Ganapatrao Kulkarni
2023-08-24  6:37           ` Ganapatrao Kulkarni
2023-08-28 10:17             ` Marc Zyngier
2023-09-01 12:15               ` Ganapatrao Kulkarni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230817060314.535987-2-gankulkarni@os.amperecomputing.com \
    --to=gankulkarni@os.amperecomputing.com \
    --cc=christoffer.dall@linaro.org \
    --cc=darren@os.amperecomputing.com \
    --cc=eauger@redhat.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=miguel.luis@oracle.com \
    --cc=scott@os.amperecomputing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox