Skip to content

Commit 620cf45

Browse files
author
Marc Zyngier
committed
KVM: arm64: Remove S1PTW check from kvm_vcpu_dabt_iswrite()
Now that kvm_vcpu_trap_is_write_fault() checks for S1PTW, there is no need for kvm_vcpu_dabt_iswrite() to do the same thing, as we already check for this condition on all existing paths. Drop the check and add a comment instead. Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c4ad98e commit 620cf45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/include/asm/kvm_emulate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,10 @@ static __always_inline bool kvm_vcpu_abt_iss1tw(const struct kvm_vcpu *vcpu)
303303
return !!(kvm_vcpu_get_esr(vcpu) & ESR_ELx_S1PTW);
304304
}
305305

306+
/* Always check for S1PTW *before* using this. */
306307
static __always_inline bool kvm_vcpu_dabt_iswrite(const struct kvm_vcpu *vcpu)
307308
{
308-
return !!(kvm_vcpu_get_esr(vcpu) & ESR_ELx_WNR) ||
309-
kvm_vcpu_abt_iss1tw(vcpu); /* AF/DBM update */
309+
return kvm_vcpu_get_esr(vcpu) & ESR_ELx_WNR;
310310
}
311311

312312
static inline bool kvm_vcpu_dabt_is_cm(const struct kvm_vcpu *vcpu)

0 commit comments

Comments
 (0)