Skip to content

Commit e4bd479

Browse files
author
Marc Zyngier
committed
KVM: arm64: Pass the walk_info structure to compute_par_s1()
Instead of just passing the translation regime, pass the full walk_info structure to compute_par_s1(). This will help further chamges that will require it. Reviewed-by: Oliver Upton <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent df1d019 commit e4bd479

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/arm64/kvm/at.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -807,8 +807,8 @@ static u64 compute_par_s12(struct kvm_vcpu *vcpu, u64 s1_par,
807807
return par;
808808
}
809809

810-
static u64 compute_par_s1(struct kvm_vcpu *vcpu, struct s1_walk_result *wr,
811-
enum trans_regime regime)
810+
static u64 compute_par_s1(struct kvm_vcpu *vcpu, struct s1_walk_info *wi,
811+
struct s1_walk_result *wr)
812812
{
813813
u64 par;
814814

@@ -823,7 +823,7 @@ static u64 compute_par_s1(struct kvm_vcpu *vcpu, struct s1_walk_result *wr,
823823
par = SYS_PAR_EL1_NSE;
824824
par |= wr->pa & GENMASK_ULL(47, 12);
825825

826-
if (regime == TR_EL10 &&
826+
if (wi->regime == TR_EL10 &&
827827
(__vcpu_sys_reg(vcpu, HCR_EL2) & HCR_DC)) {
828828
par |= FIELD_PREP(SYS_PAR_EL1_ATTR,
829829
MEMATTR(WbRaWa, WbRaWa));
@@ -838,14 +838,14 @@ static u64 compute_par_s1(struct kvm_vcpu *vcpu, struct s1_walk_result *wr,
838838

839839
par = SYS_PAR_EL1_NSE;
840840

841-
mair = (regime == TR_EL10 ?
841+
mair = (wi->regime == TR_EL10 ?
842842
vcpu_read_sys_reg(vcpu, MAIR_EL1) :
843843
vcpu_read_sys_reg(vcpu, MAIR_EL2));
844844

845845
mair >>= FIELD_GET(PTE_ATTRINDX_MASK, wr->desc) * 8;
846846
mair &= 0xff;
847847

848-
sctlr = (regime == TR_EL10 ?
848+
sctlr = (wi->regime == TR_EL10 ?
849849
vcpu_read_sys_reg(vcpu, SCTLR_EL1) :
850850
vcpu_read_sys_reg(vcpu, SCTLR_EL2));
851851

@@ -1243,7 +1243,7 @@ static u64 handle_at_slow(struct kvm_vcpu *vcpu, u32 op, u64 vaddr)
12431243
fail_s1_walk(&wr, ESR_ELx_FSC_PERM_L(wr.level), false);
12441244

12451245
compute_par:
1246-
return compute_par_s1(vcpu, &wr, wi.regime);
1246+
return compute_par_s1(vcpu, &wi, &wr);
12471247
}
12481248

12491249
/*

0 commit comments

Comments
 (0)