mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
ANDROID: KVM: arm64: Ignore length of 0 in kvm_flush_dcache_to_poc()
kvm_flush_dcache_to_poc() converts its (start,len) parameters into (start,end) parameters for dcache_clean_inval_poc(). This mostly works out except for the case when 'len == 0', where dcache_clean_inval_poc() will still issue cache maintenance for the cache line containing 'start'. If 'start' is not mapped, then this can generate an unexpected fault. In preparation for cleaning the pvmfw memory pages to the PoC on system reset, tweak kvm_flush_dcache_to_poc() to act as a no-op when the supplied length is 0 and avoid having to check for this corner case in the caller. Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Will Deacon <willdeacon@google.com> Bug: 254819795 Change-Id: Idae2b22289398e941938821d1d3b3a5a1da3fd8f
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user