Linux KVM/arm64 development list
 help / color / mirror / Atom feed
From: Fuad Tabba <tabba@google.com>
To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Cc: maz@kernel.org, oliver.upton@linux.dev, james.clark@linaro.org,
	 will@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com,
	 yuzenghui@huawei.com, catalin.marinas@arm.com,
	broonie@kernel.org,  qperret@google.com,
	kristina.martsenko@arm.com, tabba@google.com
Subject: [PATCH v5 13/17] KVM: arm64: Refactor kvm_reset_cptr_el2()
Date: Mon, 16 Dec 2024 10:50:53 +0000	[thread overview]
Message-ID: <20241216105057.579031-14-tabba@google.com> (raw)
In-Reply-To: <20241216105057.579031-1-tabba@google.com>

Fold kvm_get_reset_cptr_el2() into kvm_reset_cptr_el2(), since it
is its only caller. Add a comment to clarify that this function
is meant for the host value of cptr_el2.

No functional change intended.

Signed-off-by: Fuad Tabba <tabba@google.com>
---
 arch/arm64/include/asm/kvm_emulate.h | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h
index cf811009a33c..7b3dc52248ce 100644
--- a/arch/arm64/include/asm/kvm_emulate.h
+++ b/arch/arm64/include/asm/kvm_emulate.h
@@ -619,7 +619,8 @@ static __always_inline void kvm_write_cptr_el2(u64 val)
 		write_sysreg(val, cptr_el2);
 }
 
-static __always_inline u64 kvm_get_reset_cptr_el2(struct kvm_vcpu *vcpu)
+/* Resets the value of cptr_el2 when returning to the host. */
+static __always_inline void kvm_reset_cptr_el2(struct kvm_vcpu *vcpu)
 {
 	u64 val;
 
@@ -643,13 +644,6 @@ static __always_inline u64 kvm_get_reset_cptr_el2(struct kvm_vcpu *vcpu)
 			val &= ~CPTR_EL2_TSM;
 	}
 
-	return val;
-}
-
-static __always_inline void kvm_reset_cptr_el2(struct kvm_vcpu *vcpu)
-{
-	u64 val = kvm_get_reset_cptr_el2(vcpu);
-
 	kvm_write_cptr_el2(val);
 }
 
-- 
2.47.1.613.gc27f4b7a9f-goog


  parent reply	other threads:[~2024-12-16 10:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16 10:50 [PATCH v5 00/17] KVM: arm64: Rework guest VM fixed feature handling and trapping in pKVM Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 01/17] KVM: arm64: Consolidate allowed and restricted VM feature checks Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 02/17] KVM: arm64: Group setting traps for protected VMs by control register Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 03/17] KVM: arm64: Move checking protected vcpu features to a separate function Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 04/17] KVM: arm64: Remove KVM_ARM_VCPU_POWER_OFF from protected VMs allowed features in pKVM Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 05/17] KVM: arm64: Use KVM extension checks for allowed protected VM capabilities Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 06/17] KVM: arm64: Initialize feature id registers for protected VMs Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 07/17] KVM: arm64: Fix RAS trapping in pKVM " Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 08/17] KVM: arm64: Set protected VM traps based on its view of feature registers Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 09/17] KVM: arm64: Rework specifying restricted features for protected VMs Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 10/17] KVM: arm64: Remove fixed_config.h header Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 11/17] KVM: arm64: Remove redundant setting of HCR_EL2 trap bit Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 12/17] KVM: arm64: Calculate cptr_el2 traps on activating traps Fuad Tabba
2024-12-16 10:50 ` Fuad Tabba [this message]
2024-12-16 10:50 ` [PATCH v5 14/17] KVM: arm64: Fix the value of the CPTR_EL2 RES1 bitmask for nVHE Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 15/17] KVM: arm64: Remove PtrAuth guest vcpu flag Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 16/17] KVM: arm64: Convert the SVE guest vcpu flag to a vm flag Fuad Tabba
2024-12-16 10:50 ` [PATCH v5 17/17] KVM: arm64: Use kvm_vcpu_has_feature() directly for struct kvm Fuad Tabba
2024-12-20 15:22 ` [PATCH v5 00/17] KVM: arm64: Rework guest VM fixed feature handling and trapping in pKVM Marc Zyngier

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=20241216105057.579031-14-tabba@google.com \
    --to=tabba@google.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.clark@linaro.org \
    --cc=joey.gouly@arm.com \
    --cc=kristina.martsenko@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=qperret@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.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