summaryrefslogtreecommitdiff
path: root/arch/arm64/kvm/hyp/nvhe/pkvm.c
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2021-10-13 15:03:37 +0300
committerMarc Zyngier <maz@kernel.org>2021-10-18 18:57:08 +0300
commitce75916749b8cb5ec795f1157a5c426f6765a48c (patch)
tree9942f7d3b3fee4628d4b5da8968e0560df207aba /arch/arm64/kvm/hyp/nvhe/pkvm.c
parent8a049862c38f0c78b0e01ab5d36db1bffc832675 (diff)
downloadlinux-ce75916749b8cb5ec795f1157a5c426f6765a48c.tar.xz
KVM: arm64: pkvm: Use a single function to expose all id-regs
Rather than exposing a whole set of helper functions to retrieve individual ID registers, use the existing decoding tree and expose a single helper instead. This allow a number of functions to be made static, and we now have a single entry point to maintain. Signed-off-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Fuad Tabba <tabba@google.com> Tested-by: Fuad Tabba <tabba@google.com> Link: https://lore.kernel.org/r/20211013120346.2926621-3-maz@kernel.org
Diffstat (limited to 'arch/arm64/kvm/hyp/nvhe/pkvm.c')
-rw-r--r--arch/arm64/kvm/hyp/nvhe/pkvm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/arm64/kvm/hyp/nvhe/pkvm.c b/arch/arm64/kvm/hyp/nvhe/pkvm.c
index 633547cc1033..62377fa8a4cb 100644
--- a/arch/arm64/kvm/hyp/nvhe/pkvm.c
+++ b/arch/arm64/kvm/hyp/nvhe/pkvm.c
@@ -15,7 +15,7 @@
*/
static void pvm_init_traps_aa64pfr0(struct kvm_vcpu *vcpu)
{
- const u64 feature_ids = get_pvm_id_aa64pfr0(vcpu);
+ const u64 feature_ids = pvm_read_id_reg(vcpu, SYS_ID_AA64PFR0_EL1);
u64 hcr_set = HCR_RW;
u64 hcr_clear = 0;
u64 cptr_set = 0;
@@ -62,7 +62,7 @@ static void pvm_init_traps_aa64pfr0(struct kvm_vcpu *vcpu)
*/
static void pvm_init_traps_aa64pfr1(struct kvm_vcpu *vcpu)
{
- const u64 feature_ids = get_pvm_id_aa64pfr1(vcpu);
+ const u64 feature_ids = pvm_read_id_reg(vcpu, SYS_ID_AA64PFR1_EL1);
u64 hcr_set = 0;
u64 hcr_clear = 0;
@@ -81,7 +81,7 @@ static void pvm_init_traps_aa64pfr1(struct kvm_vcpu *vcpu)
*/
static void pvm_init_traps_aa64dfr0(struct kvm_vcpu *vcpu)
{
- const u64 feature_ids = get_pvm_id_aa64dfr0(vcpu);
+ const u64 feature_ids = pvm_read_id_reg(vcpu, SYS_ID_AA64DFR0_EL1);
u64 mdcr_set = 0;
u64 mdcr_clear = 0;
u64 cptr_set = 0;
@@ -125,7 +125,7 @@ static void pvm_init_traps_aa64dfr0(struct kvm_vcpu *vcpu)
*/
static void pvm_init_traps_aa64mmfr0(struct kvm_vcpu *vcpu)
{
- const u64 feature_ids = get_pvm_id_aa64mmfr0(vcpu);
+ const u64 feature_ids = pvm_read_id_reg(vcpu, SYS_ID_AA64MMFR0_EL1);
u64 mdcr_set = 0;
/* Trap Debug Communications Channel registers */
@@ -140,7 +140,7 @@ static void pvm_init_traps_aa64mmfr0(struct kvm_vcpu *vcpu)
*/
static void pvm_init_traps_aa64mmfr1(struct kvm_vcpu *vcpu)
{
- const u64 feature_ids = get_pvm_id_aa64mmfr1(vcpu);
+ const u64 feature_ids = pvm_read_id_reg(vcpu, SYS_ID_AA64MMFR1_EL1);
u64 hcr_set = 0;
/* Trap LOR */