diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h index b5320da8544c..9c99162b88c0 100644 --- a/arch/arm64/include/asm/kvm_mmu.h +++ b/arch/arm64/include/asm/kvm_mmu.h @@ -186,8 +186,13 @@ static inline void *__kvm_vector_slot2addr(void *base, struct kvm; -#define kvm_flush_dcache_to_poc(a,l) \ - dcache_clean_inval_poc((unsigned long)(a), (unsigned long)(a)+(l)) +#define kvm_flush_dcache_to_poc(a, l) do { \ + unsigned long __a = (unsigned long)(a); \ + unsigned long __l = (unsigned long)(l); \ + \ + if (__l) \ + dcache_clean_inval_poc(__a, __a + __l); \ +} while (0) static inline bool vcpu_has_cache_enabled(struct kvm_vcpu *vcpu) {